aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-04-01 16:37:49 +0200
committerKai Koehne <kai.koehne@digia.com>2014-04-01 17:06:46 +0200
commitc996d801f7024f3b92e1a52e75229f3b8665cfa3 (patch)
tree46331d7c74722fbed6a5c81c90bd80731296fca0
parentc5dd58fce51ba7661553ed1d9d9367d497d6fb7d (diff)
Fix crash if no qt version is registered
Change-Id: Ib3b4b2379999061b04923b98044ed83743cd6423 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
-rw-r--r--src/plugins/qtsupport/exampleslistmodel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp
index 1d8f8460d7..22f4bf66d1 100644
--- a/src/plugins/qtsupport/exampleslistmodel.cpp
+++ b/src/plugins/qtsupport/exampleslistmodel.cpp
@@ -124,6 +124,9 @@ int ExampleSetModel::indexForQtVersion(BaseQtVersion *qtVersion) const
{
// return either the entry with the same QtId, or an extra example set with same path
+ if (!qtVersion)
+ return -1;
+
// check for Qt version
for (int i = 0; i < rowCount(); ++i) {
if (getType(i) == QtExampleSet && getQtId(i) == qtVersion->uniqueId())