Skip to content

Commit

Permalink
add null safe operator to prevent web app crash
Browse files Browse the repository at this point in the history
  • Loading branch information
c3024 committed Feb 5, 2025
1 parent 5f95bc2 commit e7f7e76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/Delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function connect(email: string) {

NetworkStore.setAuthToken(response?.restrictedToken ?? null);
confirmReadyToOpenApp();
openApp().then(() => NativeModules.HybridAppModule.switchAccount(email, restrictedToken, policyID, String(previousAccountID)));
openApp().then(() => NativeModules.HybridAppModule?.switchAccount(email, restrictedToken, policyID, String(previousAccountID)));
});
})
.catch((error) => {
Expand Down Expand Up @@ -238,7 +238,7 @@ function disconnect() {
NetworkStore.setAuthToken(response?.authToken ?? null);

confirmReadyToOpenApp();
openApp().then(() => NativeModules.HybridAppModule.switchAccount(requesterEmail, authToken, '', ''));
openApp().then(() => NativeModules.HybridAppModule?.switchAccount(requesterEmail, authToken, '', ''));
});
})
.catch((error) => {
Expand Down

0 comments on commit e7f7e76

Please sign in to comment.