QmlProfiler: Fix crash in qWarning

This commit is contained in:
Kai Koehne
2011-05-03 16:45:46 +02:00
parent b7f30ed9f3
commit 7b41c76d92

View File

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