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:
@@ -34,6 +34,7 @@
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -143,6 +144,7 @@ FileName QmakeKitInformation::effectiveMkspec(const Kit *k)
|
||||
|
||||
void QmakeKitInformation::setMkspec(Kit *k, const FileName &fn)
|
||||
{
|
||||
QTC_ASSERT(k, return);
|
||||
k->setValue(QmakeKitInformation::id(), fn == defaultMkspec(k) ? QString() : fn.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user