OSDN Git Service

QmlDump: Do not use an assert on something that can regularly fail.
authorChristian Kamm <christian.d.kamm@nokia.com>
Thu, 14 Oct 2010 12:58:57 +0000 (14:58 +0200)
committerChristian Kamm <christian.d.kamm@nokia.com>
Thu, 14 Oct 2010 13:15:51 +0000 (15:15 +0200)
Reviewed-by: Kai Koehne
src/plugins/qt4projectmanager/qmldumptool.cpp

index 7ca1712..4425988 100644 (file)
@@ -161,7 +161,8 @@ static QtVersion *qtVersionForProject(ProjectExplorer::Project *project)
 
     if (project && project->id() == QLatin1String("QmlProjectManager.QmlProject")) {
         // We cannot access the QmlProject interfaces here, therefore use the metatype system
-        QTC_ASSERT(project->activeTarget() && project->activeTarget()->activeRunConfiguration(), return 0);
+        if (!project->activeTarget() || !project->activeTarget()->activeRunConfiguration())
+            return 0;
         QVariant variant = project->activeTarget()->activeRunConfiguration()->property("qtVersionId");
         QTC_ASSERT(variant.isValid() && variant.canConvert(QVariant::Int), return 0);
         QtVersion *version = QtVersionManager::instance()->version(variant.toInt());