fix crashes (info/toggle buttons, resize left panel) if no preview image has been loaded
This commit is contained in:
@@ -505,6 +505,8 @@ void EditorPanel::error (Glib::ustring descr) {
|
||||
|
||||
void EditorPanel::info_toggled () {
|
||||
|
||||
if(!ipc)
|
||||
return;
|
||||
Glib::ustring infoString;
|
||||
|
||||
const rtengine::ImageMetaData* idata = ipc->getInitialImage()->getMetaData();
|
||||
@@ -912,6 +914,9 @@ void EditorPanel::historyBeforeLineChanged (const rtengine::procparams::ProcPara
|
||||
|
||||
void EditorPanel::beforeAfterToggled () {
|
||||
|
||||
if(!ipc)
|
||||
return;
|
||||
|
||||
removeIfThere (beforeAfterBox, beforeBox, false);
|
||||
removeIfThere (afterBox, afterLabel, false);
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include <guiutils.h>
|
||||
#include <imagearea.h>
|
||||
|
||||
PreviewWindow::PreviewWindow () : previewHandler(NULL), mainCropWin(NULL),cCropMoving(NULL),cNormal(NULL), isMoving(false) {
|
||||
PreviewWindow::PreviewWindow () : previewHandler(NULL), mainCropWin(NULL),cCropMoving(NULL),cNormal(NULL), isMoving(false), imageArea(NULL) {
|
||||
|
||||
rconn = signal_size_allocate().connect( sigc::mem_fun(*this, &PreviewWindow::on_resized) );
|
||||
}
|
||||
@@ -99,7 +99,7 @@ bool PreviewWindow::on_expose_event (GdkEventExpose* event) {
|
||||
int bufferW, bufferH;
|
||||
backBuffer->get_size (bufferW, bufferH);
|
||||
|
||||
if (!mainCropWin) {
|
||||
if (!mainCropWin && imageArea) {
|
||||
mainCropWin = imageArea->getMainCropWindow ();
|
||||
if (mainCropWin)
|
||||
mainCropWin->addCropWindowListener (this);
|
||||
|
Reference in New Issue
Block a user