diff --git a/src/codePush.ts b/src/codePush.ts index 113beb31..822ddae0 100644 --- a/src/codePush.ts +++ b/src/codePush.ts @@ -314,7 +314,7 @@ class CodePush implements CodePushCapacitorPlugin { */ const syncCallbackAndUpdateSyncInProgress: Callback = (err: Error | null, result: SyncStatus | null): void => { if (err) { - syncOptions.onSyncError && syncOptions.onSyncError(err); + syncOptions?.onSyncError && syncOptions.onSyncError(err); CodePush.SyncInProgress = false; reject(err); } else {