iOS: ensure start & end are not nil

This commit is contained in:
王劲鹏 2020-05-09 11:31:00 +08:00 committed by osborn
parent 9fb84162ad
commit d060e1427c

View File

@ -348,11 +348,13 @@ - (void)requestLayout {
[colors addObject:(__bridge id) DoricColor(obj).CGColor];
}];
} else {
UIColor *start = DoricColor(dict[@"start"]);
UIColor *end = DoricColor(dict[@"end"]);
[colors addObject:(__bridge id) start.CGColor];
[colors addObject:(__bridge id) end.CGColor];
if ([dict objectForKey:@"start"] != nil && [dict objectForKey:@"end"] != nil) {
UIColor *start = DoricColor(dict[@"start"]);
UIColor *end = DoricColor(dict[@"end"]);
[colors addObject:(__bridge id) start.CGColor];
[colors addObject:(__bridge id) end.CGColor];
}
}
int orientation = [dict[@"orientation"] intValue];