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,12 +348,14 @@ - (void)requestLayout {
[colors addObject:(__bridge id) DoricColor(obj).CGColor]; [colors addObject:(__bridge id) DoricColor(obj).CGColor];
}]; }];
} else { } else {
if ([dict objectForKey:@"start"] != nil && [dict objectForKey:@"end"] != nil) {
UIColor *start = DoricColor(dict[@"start"]); UIColor *start = DoricColor(dict[@"start"]);
UIColor *end = DoricColor(dict[@"end"]); UIColor *end = DoricColor(dict[@"end"]);
[colors addObject:(__bridge id) start.CGColor]; [colors addObject:(__bridge id) start.CGColor];
[colors addObject:(__bridge id) end.CGColor]; [colors addObject:(__bridge id) end.CGColor];
} }
}
int orientation = [dict[@"orientation"] intValue]; int orientation = [dict[@"orientation"] intValue];
CGPoint startPoint; CGPoint startPoint;