diff --git a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
index f316ab9db2d38c8e9f86e7134c6158d71c39afe7..19c8d0a0973ccbc1431563ff1c166ca9251a2bc9 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
@@ -70,6 +70,8 @@ static inline QString properName(const QColor &color)
 
 static inline QColor properColor(const QString &str)
 {
+    if (str.isNull())
+        return QColor();
     int lalpha = 255;
     QString lcolorStr = str;
     if (lcolorStr.at(0) == '#' && lcolorStr.length() == 9) {