Commit 1c401481 authored by Christian Kamm's avatar Christian Kamm Committed by Kai Koehne

QmlProject: Don't crash if there's no active target.

Change-Id: I0fd95f0d388f4ba06936ec9164a91a3c53a0f005
Reviewed-on: default avatarQt Sanity Bot <>
Reviewed-by: default avatarKai Koehne <>
parent b8734dd7
......@@ -144,9 +144,11 @@ void QmlProject::refresh(RefreshOptions options)
pinfo.sourceFiles = files();
pinfo.importPaths = importPaths();
QtSupport::BaseQtVersion *version = 0;
if (activeTarget()) {
if (QmlProjectRunConfiguration *rc = qobject_cast<QmlProjectRunConfiguration *>(activeTarget()->activeRunConfiguration()))
version = rc->qtVersion();
QtSupport::QmlDumpTool::pathAndEnvironment(this, version, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
......@@ -289,9 +291,11 @@ bool QmlProject::fromMap(const QVariantMap &map)
// FIXME workaround to guarantee that run/debug actions are enabled if a valid file exists
if (activeTarget()) {
QmlProjectRunConfiguration *runConfig = qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration());
if (runConfig)
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