Skip to content

Commit c55ccb5

Browse files
committed
Add nullptr check in swift::extractNearestSourceLoc
rdar://127251788
1 parent e805679 commit c55ccb5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/DeclContext.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,9 @@ bool DeclContext::isAsyncContext() const {
14181418
}
14191419

14201420
SourceLoc swift::extractNearestSourceLoc(const DeclContext *dc) {
1421+
if (!dc)
1422+
return SourceLoc();
1423+
14211424
switch (dc->getContextKind()) {
14221425
case DeclContextKind::Package:
14231426
case DeclContextKind::Module:

0 commit comments

Comments
 (0)