Don't crash in uncaughtException() if there isn't an exception

This commit is contained in:
Dale Glass 2023-03-05 16:50:09 +01:00 committed by ksuprynowicz
parent 4beb5eceeb
commit cd02b22bd7

View file

@ -1540,7 +1540,11 @@ void ScriptEngineV8::setThread(QThread* thread) {
std::shared_ptr<ScriptException> ScriptEngineV8::uncaughtException() const {
return _uncaughtException->clone();
if (_uncaughtException) {
return _uncaughtException->clone();
} else {
return std::shared_ptr<ScriptException>();
}
}
bool ScriptEngineV8::raiseException(const QString& error, const QString &reason) {