From 7b41c76d92f50373c77cbb5fa64284100a3a4431 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 3 May 2011 16:45:46 +0200 Subject: [PATCH] QmlProfiler: Fix crash in qWarning --- src/plugins/qmlprofiler/qmlprofilertool.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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();