Add a missing check if mPtr is empty (bug #4715)

This commit is contained in:
Andrei Kortunov 2018-11-13 10:32:23 +04:00
parent 71f1a53090
commit 5e071e3eb0
2 changed files with 4 additions and 0 deletions

View file

@ -740,6 +740,9 @@ namespace MWGui
bool DialogueWindow::isCompanion(const MWWorld::Ptr& actor)
{
if (actor.isEmpty())
return false;
return !actor.getClass().getScript(actor).empty()
&& actor.getRefData().getLocals().getIntVar(actor.getClass().getScript(actor), "companion");
}