aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/api/runenvironment.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2016-06-13 22:10:42 +0300
committerOrgad Shaneh <orgads@gmail.com>2016-06-14 16:57:13 +0000
commitcd0c1e9fd91359d54d5aaeee7c6093cf8620b45f (patch)
treeb2eebcf0c24d593a08df7d5feed6e29a825c9447 /src/lib/corelib/api/runenvironment.cpp
parentabb42bdeb06ce25701d7bb35d1356c2e8ecf3b20 (diff)
RunEnvironment: Be more robust
Do not crash if resolvedProduct is not set. Fallback to initial env. Change-Id: Id08973f9f2a2715d87b38ff9d78a4a34ca526bc2 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/lib/corelib/api/runenvironment.cpp')
-rw-r--r--src/lib/corelib/api/runenvironment.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp
index 179237175..fa98f41b1 100644
--- a/src/lib/corelib/api/runenvironment.cpp
+++ b/src/lib/corelib/api/runenvironment.cpp
@@ -335,12 +335,16 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
const QProcessEnvironment RunEnvironment::getRunEnvironment() const
{
+ if (!d->resolvedProduct)
+ return d->environment;
d->resolvedProduct->setupRunEnvironment(&d->engine, d->environment);
return d->resolvedProduct->runEnvironment;
}
const QProcessEnvironment RunEnvironment::getBuildEnvironment() const
{
+ if (!d->resolvedProduct)
+ return d->environment;
d->resolvedProduct->setupBuildEnvironment(&d->engine, d->environment);
return d->resolvedProduct->buildEnvironment;
}