Commit f7ac0adf authored by El Mehdi Fekari's avatar El Mehdi Fekari Committed by Tobias Hunger

Qnx: Fix crash when running with no device

"Run" should be disabled if active the kit contains not QNX device.

Task-number: QTCREATORBUG-12143
Change-Id: I6cf9c70a8c3fc2ec63833e93840c9310345bc2b6
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 7a454508
......@@ -157,15 +157,15 @@ bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mo
return false;
}
const QnxRunConfiguration * const rc = qobject_cast<QnxRunConfiguration *>(runConfiguration);
if (mode == DebugRunMode || mode == QmlProfilerRunMode) {
const QnxDeviceConfiguration::ConstPtr dev = DeviceKitInformation::device(runConfiguration->target()->kit())
.dynamicCast<const QnxDeviceConfiguration>();
if (dev.isNull())
return false;
const QnxDeviceConfiguration::ConstPtr dev = DeviceKitInformation::device(runConfiguration->target()->kit())
.dynamicCast<const QnxDeviceConfiguration>();
if (dev.isNull())
return false;
if (mode == DebugRunMode || mode == QmlProfilerRunMode)
return rc->portsUsedByDebuggers() <= dev->freePorts().count();
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment