diff --git a/src/plugins/qmljseditor/qmljscodecompletion.cpp b/src/plugins/qmljseditor/qmljscodecompletion.cpp
index 2f4ebe5614eee9a6aa469e0c124c48843954c4d4..1096b4ff80d4f3f7a42132474bf84c55df5046aa 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);