Skip to content

Commit 9c8f325

Browse files
committed
Add a defensive nullptr check.
ASTContext::get##NAME##Type() can return an empty type and we have LLDB crash logs that show this can really happen. rdar://74503567
1 parent 58f03e8 commit 9c8f325

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,8 @@ ImportedType ClangImporter::Implementation::importMethodParamsAndReturnType(
23512351
if (kind == SpecialMethodKind::NSDictionarySubscriptGetter &&
23522352
paramTy->isObjCIdType()) {
23532353
swiftParamTy = SwiftContext.getNSCopyingType();
2354+
if (!swiftParamTy)
2355+
return {Type(), false};
23542356
if (optionalityOfParam != OTK_None)
23552357
swiftParamTy = OptionalType::get(swiftParamTy);
23562358

0 commit comments

Comments
 (0)