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