Skip to content

Commit 6cb64af

Browse files
committed
Fix null-check issue.
1 parent f8c211d commit 6cb64af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/powersync-sdk-web/src/db/sync/SharedWebStreamingSyncImplementation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ class SharedSyncClientProvider extends AbstractSharedSyncClientProvider {
2424
super();
2525
}
2626

27-
async fetchCredentials(): Promise<PowerSyncCredentials> {
27+
async fetchCredentials(): Promise<PowerSyncCredentials | null> {
2828
const credentials = await this.options.remote.getCredentials();
29+
if (credentials == null) {
30+
return null;
31+
}
2932
/**
3033
* The credentials need to be serializable.
3134
* Users might extend [PowerSyncCredentials] to contain

packages/powersync-sdk-web/src/worker/sync/AbstractSharedSyncClientProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { PowerSyncCredentials, SyncStatusOptions } from '@journeyapps/powersync-
44
* The client side port should provide these methods.
55
*/
66
export abstract class AbstractSharedSyncClientProvider {
7-
abstract fetchCredentials(): Promise<PowerSyncCredentials>;
7+
abstract fetchCredentials(): Promise<PowerSyncCredentials | null>;
88
abstract uploadCrud(): Promise<void>;
99
abstract statusChanged(status: SyncStatusOptions): void;
1010

0 commit comments

Comments
 (0)