Skip to content

Commit 721d52f

Browse files
committed
Add some missing NULL checks
1 parent dfa3ed9 commit 721d52f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,11 +2034,11 @@ SourceLoc PatternBindingDecl::getEqualLoc(unsigned i) const {
20342034
}
20352035

20362036
SourceLoc TopLevelCodeDecl::getStartLoc() const {
2037-
return Body->getStartLoc();
2037+
return Body ? Body->getStartLoc() : SourceLoc();
20382038
}
20392039

20402040
SourceRange TopLevelCodeDecl::getSourceRange() const {
2041-
return Body->getSourceRange();
2041+
return Body? Body->getSourceRange() : SourceRange();
20422042
}
20432043

20442044
SourceRange IfConfigDecl::getSourceRange() const {

0 commit comments

Comments
 (0)