mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Async Refactoring] Add missing null type check
Don't crash if we have a boolean condition without a type, as that may occur in invalid code. rdar://79864182
This commit is contained in:
@@ -4536,7 +4536,8 @@ struct CallbackCondition {
|
||||
|
||||
/// A bool condition expression.
|
||||
explicit CallbackCondition(const Expr *E) {
|
||||
if (!E->getType()->isBool())
|
||||
// FIXME: Sema should produce ErrorType.
|
||||
if (!E->getType() || !E->getType()->isBool())
|
||||
return;
|
||||
|
||||
auto CondType = ConditionType::IS_TRUE;
|
||||
|
||||
Reference in New Issue
Block a user