From 05cdda3f4ce5670daecab843156d94e9575b3997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 2 Aug 2017 07:56:22 +0200 Subject: [PATCH] Fix issue detected by Coverity, XMLElement::Attribute might return null --- lib/importproject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 80f9cbbb1..803eb1578 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -454,8 +454,11 @@ void ImportProject::importVcxproj(const std::string &filename, std::mapFirstChildElement(); e; e = e->NextSiblingElement()) { - if (std::strcmp(e->Name(), "ClCompile") == 0) - compileList.push_back(e->Attribute("Include")); + if (std::strcmp(e->Name(), "ClCompile") != 0) { + const char *include = e->Attribute("Include"); + if (include) + compileList.push_back(include); + } } } } else if (std::strcmp(node->Name(), "ItemDefinitionGroup") == 0) {