Skip to content

Commit 0094640

Browse files
Fix null shadow color crash
1 parent a0d76f3 commit 0094640

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-native/React/Views/RCTView.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,10 @@ - (void)setShadowRadius:(CGFloat)shadowRadius
764764
-(void)didUpdateShadow
765765
{
766766
NSShadow *shadow = [NSShadow new];
767-
NSColor *baseShadowColor = [NSColor colorWithCGColor:_shadowColor];
767+
NSColor *baseShadowColor = nil;
768+
if (_shadowColor != NULL) {
769+
baseShadowColor = [NSColor colorWithCGColor:_shadowColor];
770+
}
768771
shadow.shadowColor = [baseShadowColor colorWithAlphaComponent:[self shadowOpacity]];
769772
shadow.shadowOffset = [self shadowOffset];
770773
shadow.shadowBlurRadius = [self shadowRadius];

0 commit comments

Comments
 (0)