mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Don't crash on invalid Lottie json
This commit is contained in:
parent
5c94feb216
commit
ae25ca6920
1 changed files with 1 additions and 1 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue