diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-17 10:57:02 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-06-21 19:43:51 +0000 |
commit | 310d881ea0e42a4347c43ab8a9311a79d199ab34 (patch) | |
tree | 4cb76687ec86479f8f45e01d687bce91780b06b4 /src | |
parent | 16d40d5c2784146dd8bffceb7df52a0a1761e4b4 (diff) |
Check that toObject() didn't fail
Avoid a crash below if the toObject call failed and threw
an exception.
Change-Id: I82a12c5cd8892c176d345d7f4b0cf3297357f272
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index fa9cae970d..a61b5d5136 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -193,6 +193,8 @@ ReturnedValue ObjectPrototype::method_getOwnPropertySymbols(const FunctionObject return scope.engine->throwTypeError(); ScopedObject O(scope, argv[0].toObject(scope.engine)); + if (!O) + return Encode::undefined(); Heap::InternalClass *ic = O->d()->internalClass; ScopedValue n(scope); ScopedArrayObject array(scope, scope.engine->newArrayObject()); |