Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 5551cde

Browse files
committed
fix getPackageHash
1 parent d0a31d4 commit 5551cde

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CodePush.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ - (void)startRollbackTimer:(int)rollbackTimeout
184184
rejecter:(RCTPromiseRejectBlock)reject)
185185
{
186186
NSError *error;
187-
BOOL isFirstRun = (nil != packageHash
187+
BOOL isFirstRun = didUpdate
188+
&& nil != packageHash
188189
&& [packageHash length] > 0
189-
&& [packageHash isEqualToString:[CodePushPackage getCurrentPackageHash:&error]]
190-
&& didUpdate);
190+
&& [packageHash isEqualToString:[CodePushPackage getCurrentPackageHash:&error]];
191+
191192
resolve(@(isFirstRun));
192193
}
193194

CodePushPackage.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,20 @@ + (NSString *)getCurrentPackageFolderPath:(NSError **)error
7575
+ (NSString *)getCurrentPackageHash:(NSError **)error
7676
{
7777
NSDictionary *info = [self getCurrentPackageInfo:error];
78+
if (*error) {
79+
return NULL;
80+
}
81+
7882
return info[@"currentPackage"];
7983
}
8084

8185
+ (NSString *)getPreviousPackageHash:(NSError **)error
8286
{
8387
NSDictionary *info = [self getCurrentPackageInfo:error];
88+
if (*error) {
89+
return NULL;
90+
}
91+
8492
return info[@"previousPackage"];
8593
}
8694

0 commit comments

Comments
 (0)