diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-05-14 18:45:03 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-30 10:38:48 +0200 |
commit | 67a101af142355a0ca7cdc234b7ee1716a25d87c (patch) | |
tree | 1e0c99bdd9667d24e71075192d8616a3f9c2f4c4 /src/qml/qml/v8/qqmlbuiltinfunctions.cpp | |
parent | 9ba195479ac3bc2c64d43ecf26f8c97e65483a5c (diff) |
Fix potential null pointer dereferencing
These were found by
http://www.viva64.com/en/b/025
most issues are rather cosmetic.
Change-Id: I7cc12610aae6a43d26bedb9b480863c0695ddfa3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qqmlbuiltinfunctions.cpp')
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index d0d6839bdc..a7db7d214e 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -980,12 +980,13 @@ ReturnedValue QtObject::method_createQmlObject(CallContext *ctx) QQmlEngine *engine = v8engine->engine(); QQmlContextData *context = v8engine->callingContext(); + Q_ASSERT(context); QQmlContext *effectiveContext = 0; if (context->isPragmaLibraryContext) effectiveContext = engine->rootContext(); else effectiveContext = context->asQQmlContext(); - Q_ASSERT(context && effectiveContext); + Q_ASSERT(effectiveContext); QString qml = ctx->callData->args[0].toQStringNoThrow(); if (qml.isEmpty()) @@ -1086,10 +1087,10 @@ ReturnedValue QtObject::method_createComponent(CallContext *ctx) QQmlEngine *engine = v8engine->engine(); QQmlContextData *context = v8engine->callingContext(); + Q_ASSERT(context); QQmlContextData *effectiveContext = context; if (context->isPragmaLibraryContext) effectiveContext = 0; - Q_ASSERT(context); QString arg = ctx->callData->args[0].toQStringNoThrow(); if (arg.isEmpty()) |