summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-02-29 15:03:09 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2016-03-01 09:00:31 +0000
commitdfa8e27968d5650825b21101f96bd9418af1a5e9 (patch)
tree6c9e3a72dc4a6254a49375fcb4d01e02a4d25b45
parenta286c8da44e1ad2afdae83dc2fc880598272de57 (diff)
downloadqt-creator-dfa8e27968d5650825b21101f96bd9418af1a5e9.tar.gz
QmlProfiler: Check runConfiguration for 0 before accessing it
Change-Id: I274d7a75313a899a2b0c05fddbe8e189f9b99156 Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index 915d3fd84c..8d21137b8d 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<QmlProfilerRunConfigurationAspect *>(
- runConfiguration->extraAspect(Constants::SETTINGS));
- QTC_ASSERT(aspect, return 0);
-
- QmlProfilerSettings *settings = static_cast<QmlProfilerSettings *>(aspect->currentSettings());
- QTC_ASSERT(settings, return 0);
-
- d->m_profilerConnections->setFlushInterval(settings->flushEnabled() ?
- settings->flushInterval() : 0);
+ if (runConfiguration) {
+ QmlProfilerRunConfigurationAspect *aspect =
+ static_cast<QmlProfilerRunConfigurationAspect *>(
+ runConfiguration->extraAspect(Constants::SETTINGS));
+ if (aspect) {
+ QmlProfilerSettings *settings =
+ static_cast<QmlProfilerSettings *>(aspect->currentSettings());
+ d->m_profilerConnections->setFlushInterval((settings && settings->flushEnabled()) ?
+ settings->flushInterval() : 0);
+ }
+ }
QmlProfilerRunControl *engine = new QmlProfilerRunControl(sp, runConfiguration);