diff --git a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index 79b2a1ce7f13..c038b632e9aa 100644 --- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -500,8 +500,6 @@ void PlistDiagnostics::FlushDiagnosticsImpl( if (!filesMade->empty()) { StringRef lastName; PDFileEntry::ConsumerFiles *files = filesMade->getFiles(*D); - if (!files) - continue; for (PDFileEntry::ConsumerFiles::const_iterator CI = files->begin(), CE = files->end(); CI != CE; ++CI) { StringRef newName = CI->first; @@ -515,7 +513,8 @@ void PlistDiagnostics::FlushDiagnosticsImpl( } o << " " << CI->second << "\n"; } - o << " \n"; + if (!lastName.empty()) + o << " \n"; } // Close up the entry.