Fix possible crash when checking for available undo/redo

This commit is contained in:
wmayer 2013-07-23 14:46:34 +02:00
parent b1451181ea
commit 4ce0474901

View File

@ -681,10 +681,14 @@ bool View3DInventor::onHasMsg(const char* pMsg) const
return true;
else if (strcmp("SaveAs",pMsg) == 0)
return true;
else if (strcmp("Undo",pMsg) == 0)
return getAppDocument()->getAvailableUndos() > 0;
else if (strcmp("Redo",pMsg) == 0)
return getAppDocument()->getAvailableRedos() > 0;
else if (strcmp("Undo",pMsg) == 0) {
App::Document* doc = getAppDocument();
return doc && doc->getAvailableUndos() > 0;
}
else if (strcmp("Redo",pMsg) == 0) {
App::Document* doc = getAppDocument();
return doc && doc->getAvailableRedos() > 0;
}
else if (strcmp("Print",pMsg) == 0)
return true;
else if (strcmp("PrintPreview",pMsg) == 0)