From 8945acaa0f2072b3c1ffaf630416a8a56e681ea5 Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Wed, 16 Mar 2016 21:21:18 -0700 Subject: [PATCH] Binary hash w/o assets --- ios/CodePush/CodePushUpdateUtils.m | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ios/CodePush/CodePushUpdateUtils.m b/ios/CodePush/CodePushUpdateUtils.m index ca541f7..334ea87 100644 --- a/ios/CodePush/CodePushUpdateUtils.m +++ b/ios/CodePush/CodePushUpdateUtils.m @@ -175,15 +175,19 @@ NSString * const ManifestFolderPrefix = @"CodePush"; } binaryHashDictionary = [NSMutableDictionary dictionary]; - - NSString *assetsPath = [CodePushPackage getBinaryAssetsPath]; NSMutableArray *manifest = [NSMutableArray array]; - [self addContentsOfFolderToManifest:assetsPath - pathPrefix:[NSString stringWithFormat:@"%@/%@", [self manifestFolderPrefix], @"assets"] - manifest:manifest - error:error]; - if (*error) { - return nil; + + // If the app is using assets, then add + // them to the generated content manifest. + NSString *assetsPath = [CodePushPackage getBinaryAssetsPath]; + if ([[NSFileManager defaultManager] fileExistsAtPath:assetsPath]) { + [self addContentsOfFolderToManifest:assetsPath + pathPrefix:[NSString stringWithFormat:@"%@/%@", [self manifestFolderPrefix], @"assets"] + manifest:manifest + error:error]; + if (*error) { + return nil; + } } NSData *jsBundleContents = [NSData dataWithContentsOfURL:binaryBundleUrl];