[React Native] Fix immediate animation crash
This commit is contained in:
parent
929b2999c4
commit
08246b77df
|
@ -231,8 +231,10 @@ module.exports = {
|
|||
|
||||
var tickCount = Math.round(duration * ticksPerSecond / 1000);
|
||||
var samples = [];
|
||||
for (var i = 0; i <= tickCount; i++) {
|
||||
samples.push(easing.call(defaults, i / tickCount));
|
||||
if (tickCount > 0) {
|
||||
for (var i = 0; i <= tickCount; i++) {
|
||||
samples.push(easing.call(defaults, i / tickCount));
|
||||
}
|
||||
}
|
||||
|
||||
return samples;
|
||||
|
|
|
@ -114,7 +114,7 @@ RCT_EXPORT_METHOD(startAnimation:(NSNumber *)reactTag
|
|||
animationTag:(NSNumber *)animationTag
|
||||
duration:(NSTimeInterval)duration
|
||||
delay:(NSTimeInterval)delay
|
||||
easingSample:(NSArray *)easingSample
|
||||
easingSample:(NSNumberArray *)easingSample
|
||||
properties:(NSDictionary *)properties
|
||||
callback:(RCTResponseSenderBlock)callback)
|
||||
{
|
||||
|
|
|
@ -805,7 +805,9 @@ NSArray *RCTConvertArrayValue(SEL type, id json)
|
|||
for (NSInteger i = 0; i < idx; i++) {
|
||||
[(NSMutableArray *)values addObject:json[i]];
|
||||
}
|
||||
[(NSMutableArray *)values addObject:value];
|
||||
if (value) {
|
||||
[(NSMutableArray *)values addObject:value];
|
||||
}
|
||||
copy = YES;
|
||||
}
|
||||
}];
|
||||
|
|
Loading…
Reference in New Issue