Merge pull request #431 from yueyuzhao/issue/429-ios-import-project-with-text

iOS: fix app crash when importing project with text
This commit is contained in:
chrisgarrity 2021-05-28 11:56:58 -04:00 committed by GitHub
commit 5e79e777da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -313,7 +313,10 @@ NSMutableDictionary *soundtimers;
NSDictionary *page = [json valueForKey:name]; NSDictionary *page = [json valueForKey:name];
for (NSString *spriteName in [page valueForKey:@"sprites"]) { for (NSString *spriteName in [page valueForKey:@"sprites"]) {
NSDictionary *sprite = [page valueForKey:spriteName]; NSDictionary *sprite = [page valueForKey:spriteName];
[sprites setValue:sprite forKey:[sprite valueForKey:@"md5"]]; NSString *md5 = [sprite valueForKey:@"md5"];
if (md5 != nil) {
[sprites setValue:sprite forKey:md5];
}
} }
} }