OSDN Git Service

Fix crash in QMakeStep::allArguments
authordt <qtc-committer@nokia.com>
Mon, 16 May 2011 10:18:07 +0000 (12:18 +0200)
committerdt <qtc-committer@nokia.com>
Mon, 16 May 2011 10:18:20 +0000 (12:18 +0200)
qtVersion can be null now

src/plugins/qt4projectmanager/qmakestep.cpp

index ca27219..e69cfdc 100644 (file)
@@ -137,10 +137,14 @@ QString QMakeStep::allArguments(bool shorted)
 
     if (!haveSpec) {
         const QString tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : QString();
-        if (!tcSpec.isEmpty() && bc->qtVersion()->hasMkspec(tcSpec))
+        if (tcSpec.isEmpty()) {
+            if (bc->qtVersion())
+                arguments << "-spec" << bc->qtVersion()->mkspec();
+        } else if (!bc->qtVersion() || bc->qtVersion()->hasMkspec(tcSpec)) {
             arguments << "-spec" << tcSpec;
-        else
+        } else {
             arguments << "-spec" << bc->qtVersion()->mkspec();
+        }
     }
 
     // Find out what flags we pass on to qmake