Prevent null pointer access

Thanks to Ingo for fixing the segfault.
This commit is contained in:
Lawrence Lee
2020-09-28 22:17:49 -07:00
parent be858363a6
commit b8af429f0e
2 changed files with 4 additions and 2 deletions

View File

@@ -364,7 +364,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
}
imgsrc->getRAWHistogram(histRedRaw, histGreenRaw, histBlueRaw);
hist_raw_dirty = !hListener->updateHistogramRaw();
hist_raw_dirty = !(hListener && hListener->updateHistogramRaw());
highDetailPreprocessComputed = highDetailNeeded;

View File

@@ -469,7 +469,9 @@ public:
hListener->setObservable(nullptr);
}
hListener = h;
h->setObservable(this);
if (h) {
h->setObservable(this);
}
}
void setAutoCamListener (AutoCamListener* acl) override
{