diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-12-13 01:28:46 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-12-13 00:02:08 +0100 |
commit | c4aa210e58e59d8cce233bfc5e9eb12ebda66a79 (patch) | |
tree | aa728a368cd7d4856b408e5bb28fce2a2a9b2488 /qmljs_runtime.cpp | |
parent | c267edf74b5e8fba75e2191dc70aeb11f11edce0 (diff) |
Fix a possible crash when setting a property on a primitive type
Change-Id: Icb8d97536b87779cdc3e543260755509232e10cb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qmljs_runtime.cpp')
-rw-r--r-- | qmljs_runtime.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 5ef2c6c9f0..1768cbf1d1 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -544,6 +544,8 @@ Value __qmljs_new_string_object(ExecutionContext *ctx, String *string) void __qmljs_set_property(ExecutionContext *ctx, Value object, String *name, Value value) { + if (! object.isObject()) + object = __qmljs_to_object(object, ctx); object.objectValue()->__put__(ctx, name, value); } |