Skip to content

Commit 1e66ee6

Browse files
author
David Ungar
committed
Another null-pointer fix.
1 parent 4a194a9 commit 1e66ee6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/AST/DiagnosticConsumer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ void FileSpecificDiagnosticConsumer::handleDiagnostic(
182182

183183
if (!specificConsumer.hasValue()) {
184184
for (auto &subConsumer : SubConsumers) {
185-
subConsumer.second->handleDiagnostic(SM, Loc, Kind, FormatString,
186-
FormatArgs, Info);
185+
if (subConsumer.second) {
186+
subConsumer.second->handleDiagnostic(SM, Loc, Kind, FormatString,
187+
FormatArgs, Info);
188+
}
187189
}
188190
} else if (DiagnosticConsumer *c = specificConsumer.getValue())
189191
c->handleDiagnostic(SM, Loc, Kind, FormatString, FormatArgs, Info);

0 commit comments

Comments
 (0)