Fix crash if no qt version is registered

Change-Id: Ib3b4b2379999061b04923b98044ed83743cd6423
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
This commit is contained in:
Kai Koehne
2014-04-01 16:37:49 +02:00
parent c5dd58fce5
commit c996d801f7

View File

@@ -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 // return either the entry with the same QtId, or an extra example set with same path
if (!qtVersion)
return -1;
// check for Qt version // check for Qt version
for (int i = 0; i < rowCount(); ++i) { for (int i = 0; i < rowCount(); ++i) {
if (getType(i) == QtExampleSet && getQtId(i) == qtVersion->uniqueId()) if (getType(i) == QtExampleSet && getQtId(i) == qtVersion->uniqueId())