From ae25ca692036b9c689a7984b029640cb786e36b1 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 11 Sep 2019 08:01:49 +0300 Subject: [PATCH] Don't crash on invalid Lottie json --- .../lottie-ios/lottie-ios/Classes/Private/LOTComposition.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/lottie-ios/lottie-ios/Classes/Private/LOTComposition.m b/submodules/lottie-ios/lottie-ios/Classes/Private/LOTComposition.m index e84d117431..39ffd09b05 100644 --- a/submodules/lottie-ios/lottie-ios/Classes/Private/LOTComposition.m +++ b/submodules/lottie-ios/lottie-ios/Classes/Private/LOTComposition.m @@ -63,7 +63,7 @@ NSData *jsonData = [[NSData alloc] initWithContentsOfFile:filePath]; NSDictionary *JSONObject = jsonData ? [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error] : nil; - if (JSONObject && !error) { + if (JSONObject && [JSONObject isKindOfClass:[NSDictionary class]] && !error) { LOTComposition *laScene = [[self alloc] initWithJSON:JSONObject withAssetBundle:[NSBundle mainBundle]]; laScene.rootDirectory = [filePath stringByDeletingLastPathComponent]; [[LOTAnimationCache sharedCache] addAnimation:laScene forKey:animationName];