Skip to content

Commit

Permalink
Merge pull request #56395 from c3024/add-null-safe-chaining-operator-…
Browse files Browse the repository at this point in the history
…for-preventing-crash-on-web-and-desktop-apps

Prevent app crash on web and desktop when switching between delegator and user accounts
  • Loading branch information
mjasikowski authored Feb 5, 2025
2 parents 27780d5 + e7f7e76 commit 4bf233e
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 4bf233e

Please sign in to comment.