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

Commit f500e51

Browse files
committed
add null check
1 parent 4ff77d8 commit f500e51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CodePush.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ const sync = (() => {
191191

192192
return (options = {}, syncStatusChangeCallback, downloadProgressCallback) => {
193193
if (syncInProgress) {
194-
syncStatusChangeCallback(CodePush.SyncStatus.SYNC_IN_PROGRESS);
194+
typeof syncStatusChangeCallback == "function"
195+
? syncStatusChangeCallback(CodePush.SyncStatus.SYNC_IN_PROGRESS)
196+
: log("Sync already in progress.");
195197
return Promise.resolve(CodePush.SyncStatus.SYNC_IN_PROGRESS);
196198
}
197199

0 commit comments

Comments
 (0)