From c996d801f7024f3b92e1a52e75229f3b8665cfa3 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 1 Apr 2014 16:37:49 +0200 Subject: [PATCH] Fix crash if no qt version is registered Change-Id: Ib3b4b2379999061b04923b98044ed83743cd6423 Reviewed-by: Alessandro Portale --- src/plugins/qtsupport/exampleslistmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 1d8f8460d7e..22f4bf66d1f 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())