forked from qt-creator/qt-creator
KitInformation: Improve robustness to nullptr passed as kit
All the KitInformation methods need to gracefully handle a kit that is a nullptr. Ensure this is indeed the case. This might fix the actual trigger for QTCREATORBUG-19469. Change-Id: Id78ac8a26c1be908f41a425ff1935b86888e4b8b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include <projectexplorer/kitconfigwidget.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <qbs.h>
|
||||
|
||||
#include <QLabel>
|
||||
@@ -89,11 +91,13 @@ QString QbsKitInformation::representation(const Kit *kit)
|
||||
|
||||
QVariantMap QbsKitInformation::properties(const Kit *kit)
|
||||
{
|
||||
QTC_ASSERT(kit, return QVariantMap());
|
||||
return kit->value(id()).toMap();
|
||||
}
|
||||
|
||||
void QbsKitInformation::setProperties(Kit *kit, const QVariantMap &properties)
|
||||
{
|
||||
QTC_ASSERT(kit, return);
|
||||
kit->setValue(id(), properties);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user