Commit ec5a669b authored by hjk's avatar hjk

ProjectExplorer: Disable copying steps to inactive kits

This fixes a hard crash due to a Target nullptr.

Change-Id: I3065ac61bc950413d8958bcad5420f5868afd35c
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent bdd0c837
......@@ -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;
......
......@@ -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());
......
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