summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2016-06-28 13:28:28 +0200
committerEike Ziller <eike.ziller@qt.io>2016-06-28 11:56:10 +0000
commitccc46bbe46f6385968f5e4fb71bb20a4fc37f73a (patch)
tree110da35d2583d28105789c9b9c8cff0abbd88b1c
parent438697219ff8ae4ad78ed5cd176abcce10bc7348 (diff)
downloadqt-creator-ccc46bbe46f6385968f5e4fb71bb20a4fc37f73a.tar.gz
Fix crashes with (Runnable|Connection)::is<T>()
Another regression of 3f11ef92167 Default constructed Runnables/Connections have zero d pointer. Task-number: QTCREATORBUG-16507 Change-Id: I230b661eba4c408a353a711f93f3163160980793 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: hjk <hjk@theqtcompany.com>
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index 225c04bf43..fd4fa28842 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -195,7 +195,7 @@ public:
void operator=(Runnable other) { d = std::move(other.d); }
template <class T> bool is() const {
- return d.get()->typeId() == T::staticTypeId;
+ return d.get() && (d.get()->typeId() == T::staticTypeId);
}
template <class T> const T &as() const {
@@ -219,7 +219,7 @@ public:
void operator=(Connection other) { d = std::move(other.d); }
template <class T> bool is() const {
- return d.get()->typeId() == T::staticTypeId;
+ return d.get() && (d.get()->typeId() == T::staticTypeId);
}
template <class T> const T &as() const {