History

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

Dale Glass committed 3 years ago

Commit cd02b221 parent 4beb5ec1 file · +5 −1Browse files

Showing the changes to libraries/script-engine/src/v8/ScriptEngineV8.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/v8/ScriptEngineV8.cpp+5−1
@@ -1540,7 +1540,11 @@ void ScriptEngineV8::setThread(QThread* thread) { · 1539 unmodified lines
15401540
15411541
15421542 std::shared_ptr<ScriptException> ScriptEngineV8::uncaughtException() const {
1543− return _uncaughtException->clone();
1543+ if (_uncaughtException) {
1544+ return _uncaughtException->clone();
1545+ } else {
1546+ return std::shared_ptr<ScriptException>();
1547+ }
15441548 }
15451549
15461550 bool ScriptEngineV8::raiseException(const QString& error, const QString &reason) {