forked from qt-creator/qt-creator
Fix crashes when no default profile is set
* Handle 0 when calling createTarget to avoid the crashes in the first place * Do not try to create/add targets for 0 profiles to avoid creator writing a warning to the console * Fix possible crashes in debugger when no default profile is set. Task-number: QTCREATORBUG-7695 Change-Id: I9afc8e29c8b859ad078dad794ef5017168daac78 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -539,8 +539,9 @@ bool CMakeProject::fromMap(const QVariantMap &map)
|
||||
if (!Project::fromMap(map))
|
||||
return false;
|
||||
|
||||
if (!activeTarget())
|
||||
addTarget(createTarget(ProfileManager::instance()->defaultProfile()));
|
||||
Profile *defaultProfile = ProfileManager::instance()->defaultProfile();
|
||||
if (!activeTarget() && defaultProfile)
|
||||
addTarget(createTarget(defaultProfile));
|
||||
|
||||
// We have a user file, but we could still be missing the cbp file
|
||||
// or simply run createXml with the saved settings
|
||||
|
Reference in New Issue
Block a user