OutputFormatter factories: Handle the "no target" case

Amends d42920d372.

Change-Id: I302c4e54cbe2dcc2340deffa99237e909418939d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-04-22 10:20:36 +02:00
parent bf1bbbac05
commit b7de4eb263
2 changed files with 2 additions and 2 deletions

View File

@@ -338,7 +338,7 @@ PythonRunConfigurationFactory::PythonRunConfigurationFactory()
PythonOutputFormatterFactory::PythonOutputFormatterFactory()
{
setFormatterCreator([](Target *t) -> OutputLineParser * {
if (t->project()->mimeType() == Constants::C_PY_MIMETYPE)
if (t && t->project()->mimeType() == Constants::C_PY_MIMETYPE)
return new PythonOutputLineParser;
return nullptr;
});

View File

@@ -243,7 +243,7 @@ void QtOutputLineParser::updateProjectFileList()
QtOutputFormatterFactory::QtOutputFormatterFactory()
{
setFormatterCreator([](Target *t) -> OutputLineParser * {
BaseQtVersion *qt = QtKitAspect::qtVersion(t->kit());
BaseQtVersion *qt = QtKitAspect::qtVersion(t ? t->kit() : nullptr);
return qt ? new QtOutputLineParser(t) : nullptr;
});
}