Fix importing of .user files

Task-number: QTCREATORBUG-7654
Change-Id: Ie22930861f843acb9e765423d72b23445cbe48e4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Tobias Hunger
2012-08-07 14:01:52 +02:00
parent 7d6de2e105
commit 918c27002b
2 changed files with 137 additions and 118 deletions

View File

@@ -356,9 +356,7 @@ bool Project::fromMap(const QVariantMap &map)
if (!ok || maxI < 0)
maxI = 0;
int active(map.value(QLatin1String(ACTIVE_TARGET_KEY), 0).toInt(&ok));
if (!ok || active < 0)
active = 0;
if (0 > active || maxI < active)
if (!ok || active < 0 || active >= maxI)
active = 0;
for (int i = 0; i < maxI; ++i) {