diff options
author | hjk <hjk@qt.io> | 2017-01-19 10:22:38 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-01-19 09:52:39 +0000 |
commit | ec5a669b395debbda2aab3fa04bdb8504d55eb9a (patch) | |
tree | fb79adf7c25d1f6998237042f78484cd1f8d6335 | |
parent | bdd0c8375125a618f930d869ff135bffcda76b36 (diff) |
ProjectExplorer: Disable copying steps to inactive kits
This fixes a hard crash due to a Target nullptr.
Change-Id: I3065ac61bc950413d8958bcad5420f5868afd35c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r-- | src/plugins/projectexplorer/project.cpp | 1 | ||||
-rw-r--r-- | src/plugins/projectexplorer/targetsettingspanel.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index b48f8d36dd..945fef74aa 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -276,6 +276,7 @@ Target *Project::createTarget(Kit *k) bool Project::copySteps(Target *sourceTarget, Target *newTarget) { + QTC_ASSERT(newTarget, return false); bool fatalError = false; QStringList buildconfigurationError; QStringList deployconfigurationError; diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index 1712153301..c6c237e2e3 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -447,7 +447,7 @@ public: }); QMenu *copyMenu = menu->addMenu(tr("Copy Steps From Other Kit...")); - if (m_kitId.isValid()) { + if (m_kitId.isValid() && m_project->target(m_kitId)) { const QList<Kit *> kits = KitManager::kits(); for (Kit *kit : kits) { QAction *copyAction = copyMenu->addAction(kit->displayName()); |