diff --git a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m index 0529a91e..e1bb7951 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m @@ -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];