Merge pull request #4137 from ctrlaltdavid/null-dereference

Guard against derefencing NULL
This commit is contained in:
Clément Brisset 2015-01-20 11:31:04 -08:00
commit a41ef94f5c

View file

@ -220,7 +220,12 @@ unsigned int Overlays::cloneOverlay(unsigned int id) {
} else if (_overlaysWorld.contains(id)) {
thisOverlay = _overlaysWorld[id];
}
return addOverlay(thisOverlay->createClone());
if (thisOverlay) {
return addOverlay(thisOverlay->createClone());
}
return 0; // Not found
}
bool Overlays::editOverlay(unsigned int id, const QScriptValue& properties) {