15803: Add checks that user uuid (from getUserUuid) is defined
[arvados-workbench2.git] / src / store / link-account-panel / link-account-panel-actions.ts
index 108b77478727c0f3ce45298687580c60bafb7c4d..6540ee696ac33f464f9c888bda080c98dffaaa44 100644 (file)
@@ -204,7 +204,9 @@ export const loadLinkAccountPanel = () =>
 
 export const startLinking = (t: LinkAccountType) =>
     (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
-        const accountToLink = { type: t, userUuid: getUserUuid(getState()), token: services.authService.getApiToken() } as AccountToLink;
+        const userUuid = getUserUuid(getState());
+        if (!userUuid) { return; }
+        const accountToLink = { type: t, userUuid, token: services.authService.getApiToken() } as AccountToLink;
         services.linkAccountService.saveAccountToLink(accountToLink);
 
         const auth = getState().auth;