logic: add another codeblocks related null check

This commit is contained in:
mlangkabel
2020-11-18 17:11:03 +01:00
parent 4b6b58de86
commit d3873213f1
@@ -225,26 +225,26 @@ std::vector<std::shared_ptr<IndexerCommandCxx>> Project::getIndexerCommands(
sourceGroupSettings->getFrameworkSearchPathsExpandedAndAbsolute(),
appSettings->getFrameworkSearchPathsExpanded());
OrderedCache<std::wstring, std::vector<std::wstring>> optionsCache(
[&](const std::wstring& targetName) {
OrderedCache<std::wstring, std::vector<std::wstring>> optionsCache([&](const std::wstring& targetName) {
std::vector<std::wstring> compilerFlags;
for (std::shared_ptr<Target> target: m_targets)
{
if (target->getTitle() == targetName)
if (target && target->getTitle() == targetName)
{
if (std::shared_ptr<const Compiler> compiler = target->getCompiler())
{
compilerFlags = utility::concat(
IndexerCommandCxx::getCompilerFlagsForSystemHeaderSearchPaths(
utility::convert<std::wstring, FilePath>(
target->getCompiler()->getDirectories())),
target->getCompiler()->getOptions());
utility::convert<std::wstring, FilePath>(compiler->getDirectories())),
compiler->getOptions());
break;
}
}
}
utility::append(
compilerFlags,
IndexerCommandCxx::getCompilerFlagsForSystemHeaderSearchPaths(
systemHeaderSearchPaths));
IndexerCommandCxx::getCompilerFlagsForSystemHeaderSearchPaths(systemHeaderSearchPaths));
utility::append(
compilerFlags,
IndexerCommandCxx::getCompilerFlagsForFrameworkSearchPaths(frameworkSearchPaths));