Skip to content

Commit 8d1c1bf

Browse files
committed
[IDE] Bail from IDEInspectionSecondPassRequest if parserState is null
This shouldn't ever happen, but let's at least make sure we don't crash.
1 parent d6f8d8c commit 8d1c1bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Parse/Parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bool IDEInspectionSecondPassRequest::evaluate(
116116
IDEInspectionCallbacksFactory *Factory) const {
117117
// If we didn't find the code completion token, bail.
118118
auto *parserState = SF->getDelayedParserState();
119-
if (!parserState->hasIDEInspectionDelayedDeclState())
119+
if (!parserState || !parserState->hasIDEInspectionDelayedDeclState())
120120
return true;
121121

122122
// Decrement the closure discriminator index by one so a top-level closure

0 commit comments

Comments
 (0)