From c472241ad1b1103f038331d61021725f91b322b0 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 30 May 2016 16:27:46 +0200 Subject: [PATCH] QmlProfiler: Don't connect() null pointers Change-Id: Id97a5f2231608ae14d7122f168808b2e0264815b Reviewed-by: Joerg Bornemann --- src/plugins/qmlprofiler/flamegraph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmlprofiler/flamegraph.cpp b/src/plugins/qmlprofiler/flamegraph.cpp index 09f3ad780ec..9d6cac7baf2 100644 --- a/src/plugins/qmlprofiler/flamegraph.cpp +++ b/src/plugins/qmlprofiler/flamegraph.cpp @@ -58,7 +58,8 @@ void FlameGraph::setModel(QAbstractItemModel *model) disconnect(m_model, &QAbstractItemModel::modelReset, this, &FlameGraph::rebuild); m_model = model; - connect(m_model, &QAbstractItemModel::modelReset, this, &FlameGraph::rebuild); + if (m_model) + connect(m_model, &QAbstractItemModel::modelReset, this, &FlameGraph::rebuild); emit modelChanged(model); rebuild(); }