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:
Tobias Hunger
2018-02-12 12:49:22 +01:00
parent d5c449575e
commit 3874b6b6ec
7 changed files with 68 additions and 23 deletions

View File

@@ -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());
}