ProjectExplorer: Fix possible crash in RunControl

There is not necessarily a run configuration.

Change-Id: I53e0a0ab322bcf1cbac2cbb6944602aeed933432
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Christian Kandeler
2020-05-13 17:22:13 +02:00
committed by Nikolai Kosjar
parent cbb70513bf
commit c563046145

View File

@@ -827,7 +827,8 @@ void RunControlPrivate::showError(const QString &msg)
QList<Utils::OutputLineParser *> RunControl::createOutputParsers() const
{
QList<Utils::OutputLineParser *> parsers = OutputFormatterFactory::createFormatters(target());
if (const auto customParsersAspect = runConfiguration()->aspect<CustomParsersAspect>()) {
if (const auto customParsersAspect
= (runConfiguration() ? runConfiguration()->aspect<CustomParsersAspect>() : nullptr)) {
for (const Core::Id id : customParsersAspect->parsers()) {
if (CustomParser * const parser = CustomParser::createFromId(id))
parsers << parser;