Commit 2f65d601 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Make sure to check if requested image exists, otherwise return null. Also...

Make sure to check if requested image exists, otherwise return null. Also check for out of bound id values in the histogram and limit them
parent 41555bf4
......@@ -121,6 +121,8 @@ void FITSHistogram::constructHistogram(int hist_width, int hist_height)
if (id >= hist_width)
id = hist_width - 1;
else if (id < 0)
id=0;
//histArray[id]++;
histArray[id]++;
......
......@@ -554,15 +554,12 @@ void FITSViewer::applyFilter(int ftype)
FITSView * FITSViewer::getImage(int fitsUID)
{
//if (fitsUID < 0 || fitsUID >= fitsImages.size())
// return NULL;
FITSTab *tab = fitsMap.value(fitsUID);
return tab->getImage();
//return fitsImages[fitsUID]->getImage();
if (tab)
return tab->getImage();
else
return NULL;
}
#include "fitsviewer.moc"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment