diff options
author | Simon Hausmann <[email protected]> | 2014-07-23 15:10:58 +0200 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2014-07-31 09:03:00 +0200 |
commit | 2064a262bfeca56820b906d89f0255e5185f3320 (patch) | |
tree | 6b832758d32fd4c1d008d20f95197dcef4f269f6 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 59d5c5cf555a51cd7559cea197a198ef3a792614 (diff) |
Fix crash when throwing an exception from within a constructor
We need to check for the exception before doing anything with the returned
value.
Change-Id: I0086be96b2df2434b95187489d7430ae67f561a1
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 10974780f3..29628eb3ee 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -386,6 +386,9 @@ ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData) if (f->function()->compiledFunction->hasQmlDependencies()) QmlContextWrapper::registerQmlDependencies(v4, f->function()->compiledFunction); + if (v4->hasException) + return Encode::undefined(); + if (result->isObject()) return result.asReturnedValue(); return obj.asReturnedValue(); |