forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -276,6 +276,7 @@ Target *Project::createTarget(Kit *k)
|
|||||||
|
|
||||||
bool Project::copySteps(Target *sourceTarget, Target *newTarget)
|
bool Project::copySteps(Target *sourceTarget, Target *newTarget)
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(newTarget, return false);
|
||||||
bool fatalError = false;
|
bool fatalError = false;
|
||||||
QStringList buildconfigurationError;
|
QStringList buildconfigurationError;
|
||||||
QStringList deployconfigurationError;
|
QStringList deployconfigurationError;
|
||||||
|
@@ -447,7 +447,7 @@ public:
|
|||||||
});
|
});
|
||||||
|
|
||||||
QMenu *copyMenu = menu->addMenu(tr("Copy Steps From Other Kit..."));
|
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();
|
const QList<Kit *> kits = KitManager::kits();
|
||||||
for (Kit *kit : kits) {
|
for (Kit *kit : kits) {
|
||||||
QAction *copyAction = copyMenu->addAction(kit->displayName());
|
QAction *copyAction = copyMenu->addAction(kit->displayName());
|
||||||
|
Reference in New Issue
Block a user