[React Native] Fix immediate animation crash

This commit is contained in:
Alex Akers 2015-05-05 07:16:53 -07:00
parent 929b2999c4
commit 08246b77df
3 changed files with 8 additions and 4 deletions

View File

@ -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;

View File

@ -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)
{

View File

@ -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;
}
}];