forked from qt-creator/qt-creator
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:
@@ -193,15 +193,17 @@ QmlProfilerTool::~QmlProfilerTool()
|
|||||||
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
|
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
|
||||||
RunConfiguration *runConfiguration)
|
RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
QmlProfilerRunConfigurationAspect *aspect = static_cast<QmlProfilerRunConfigurationAspect *>(
|
if (runConfiguration) {
|
||||||
runConfiguration->extraAspect(Constants::SETTINGS));
|
QmlProfilerRunConfigurationAspect *aspect =
|
||||||
QTC_ASSERT(aspect, return 0);
|
static_cast<QmlProfilerRunConfigurationAspect *>(
|
||||||
|
runConfiguration->extraAspect(Constants::SETTINGS));
|
||||||
QmlProfilerSettings *settings = static_cast<QmlProfilerSettings *>(aspect->currentSettings());
|
if (aspect) {
|
||||||
QTC_ASSERT(settings, return 0);
|
QmlProfilerSettings *settings =
|
||||||
|
static_cast<QmlProfilerSettings *>(aspect->currentSettings());
|
||||||
d->m_profilerConnections->setFlushInterval(settings->flushEnabled() ?
|
d->m_profilerConnections->setFlushInterval((settings && settings->flushEnabled()) ?
|
||||||
settings->flushInterval() : 0);
|
settings->flushInterval() : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QmlProfilerRunControl *engine = new QmlProfilerRunControl(sp, runConfiguration);
|
QmlProfilerRunControl *engine = new QmlProfilerRunControl(sp, runConfiguration);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user