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>
This commit is contained in:
Ulf Hermann
2016-02-29 15:03:09 +01:00
parent a286c8da44
commit dfa8e27968

View File

@@ -193,15 +193,17 @@ QmlProfilerTool::~QmlProfilerTool()
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
QmlProfilerRunConfigurationAspect *aspect = static_cast<QmlProfilerRunConfigurationAspect *>(
if (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() ?
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);