MADS: Check 'dialog' earlier to avoid untested null dereference

This commit is contained in:
Strangerke 2016-01-11 07:02:49 +01:00
parent 07f82d0b38
commit 60443e49e8

View File

@ -171,12 +171,12 @@ bool DialogsNebular::show(int messageId, int objectId) {
crFlag = false;
}
if (!centerFlag)
dialog->incNumLines();
if (!dialog)
error("DialogsNebular::show - Uninitialized dialog");
if (!centerFlag)
dialog->incNumLines();
// Show the dialog
_vm->_events->setCursor(CURSOR_ARROW);
dialog->show();