From dfa8e27968d5650825b21101f96bd9418af1a5e9 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 29 Feb 2016 15:03:09 +0100 Subject: QmlProfiler: Check runConfiguration for 0 before accessing it Change-Id: I274d7a75313a899a2b0c05fddbe8e189f9b99156 Reviewed-by: hjk Reviewed-by: David Schulz --- src/plugins/qmlprofiler/qmlprofilertool.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 915d3fd84c6..8d21137b8d9 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -193,15 +193,17 @@ QmlProfilerTool::~QmlProfilerTool() AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration) { - QmlProfilerRunConfigurationAspect *aspect = static_cast( - runConfiguration->extraAspect(Constants::SETTINGS)); - QTC_ASSERT(aspect, return 0); - - QmlProfilerSettings *settings = static_cast(aspect->currentSettings()); - QTC_ASSERT(settings, return 0); - - d->m_profilerConnections->setFlushInterval(settings->flushEnabled() ? - settings->flushInterval() : 0); + if (runConfiguration) { + QmlProfilerRunConfigurationAspect *aspect = + static_cast( + runConfiguration->extraAspect(Constants::SETTINGS)); + if (aspect) { + QmlProfilerSettings *settings = + static_cast(aspect->currentSettings()); + d->m_profilerConnections->setFlushInterval((settings && settings->flushEnabled()) ? + settings->flushInterval() : 0); + } + } QmlProfilerRunControl *engine = new QmlProfilerRunControl(sp, runConfiguration); -- cgit v1.2.3