mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ASTPrinter] Add missing null check in isNonSendableExtension
The extended nominal may not be present for an invalid extension. rdar://149032713
This commit is contained in:
@@ -2234,8 +2234,11 @@ bool isNonSendableExtension(const Decl *D) {
|
||||
if (!ED || !ED->isUnavailable())
|
||||
return false;
|
||||
|
||||
auto nonSendable =
|
||||
ED->getExtendedNominal()->getAttrs().getEffectiveSendableAttr();
|
||||
auto *NTD = ED->getExtendedNominal();
|
||||
if (!NTD)
|
||||
return false;
|
||||
|
||||
auto nonSendable = NTD->getAttrs().getEffectiveSendableAttr();
|
||||
if (!isa_and_nonnull<NonSendableAttr>(nonSendable))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user