Guard against derefencing NULL

This commit is contained in:
David Rowe 2015-01-19 19:33:12 -08:00
parent c7c7c35654
commit 214a18c446

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) {