Skip to content

Commit c0e82ec

Browse files
committed
Prevent casting null pointer
1 parent 765f8ac commit c0e82ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Sema/TypeCheckConcurrency.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,9 @@ bool diagnoseNonSendableTypesWithSendingCheck(
459459
return false;
460460
}
461461
if (auto *subscript = dyn_cast<SubscriptDecl>(decl)) {
462-
if (isa<SendingTypeRepr>(subscript->getResultTypeRepr()))
463-
return false;
462+
if (auto resultTypeRepr = subscript->getResultTypeRepr())
463+
if (isa<SendingTypeRepr>(resultTypeRepr))
464+
return false;
464465
}
465466

466467
return diagnoseNonSendableTypes(

0 commit comments

Comments
 (0)