Avoid dereference after null check

This commit is contained in:
Andrei Kortunov 2018-08-01 19:30:30 +04:00
parent 1c13256456
commit a08048da4e
3 changed files with 5 additions and 4 deletions

View file

@ -82,7 +82,7 @@ namespace MWGui
dialog->eventOkClicked.clear();
dialog->eventOkClicked += MyGUI::newDelegate(this, &ContainerWindow::dragItem);
}
else
else if (mModel)
dragItem (NULL, count);
}

View file

@ -898,6 +898,7 @@ namespace MWGui
mKeyboardNavigation->onFrame();
if (mMessageBoxManager)
mMessageBoxManager->onFrame(frameDuration);
mToolTips->onFrame(frameDuration);

View file

@ -1180,9 +1180,9 @@ namespace MWWorld
addContainerScripts (getPlayerPtr(), newCell);
newPtr = getPlayerPtr();
}
else
else if (currCell)
{
bool currCellActive = currCell && mWorldScene->isCellActive(*currCell);
bool currCellActive = mWorldScene->isCellActive(*currCell);
bool newCellActive = newCell && mWorldScene->isCellActive(*newCell);
if (!currCellActive && newCellActive)
{