diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 1c199fa77f6..b14800bcdfe 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -431,8 +431,13 @@ void QmlProfilerTool::tryToConnect() } else if (d->m_connectionAttempts == 50) { d->m_connectionTimer.stop(); d->m_connectionAttempts = 0; - if (QmlProfilerPlugin::debugOutput) - qWarning("QmlProfiler: Failed to connect: %s", qPrintable(d->m_client->errorString())); + if (QmlProfilerPlugin::debugOutput) { + if (d->m_client) { + qWarning("QmlProfiler: Failed to connect: %s", qPrintable(d->m_client->errorString())); + } else { + qWarning("QmlProfiler: Failed to connect."); + } + } emit connectionFailed(); } else { connectToClient();