From 42e49fcc4fae433d00f48cfec51428d6ae1cb536 Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Fri, 12 Nov 2010 11:12:34 +0100
Subject: [PATCH] QmlJS: Add missing null check for completion in string
 literals.

---
 src/plugins/qmljseditor/qmljscodecompletion.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qmljseditor/qmljscodecompletion.cpp b/src/plugins/qmljseditor/qmljscodecompletion.cpp
index 2f4ebe5614e..1096b4ff80d 100644
--- a/src/plugins/qmljseditor/qmljscodecompletion.cpp
+++ b/src/plugins/qmljseditor/qmljscodecompletion.cpp
@@ -781,7 +781,9 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
     if (contextFinder.isInStringLiteral()) {
         const Interpreter::Value *value = getPropertyValue(qmlScopeType, contextFinder.bindingPropertyName(), context);
 
-        if (value->asUrlValue()) {
+        if (!value) {
+            // do nothing
+        } else if (value->asUrlValue()) {
             QTextCursor tc = edit->textCursor();
             QmlExpressionUnderCursor expressionUnderCursor;
             expressionUnderCursor(tc);
-- 
GitLab