X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/4a055bfc98a5fc05cc311e2de1ab2213eec5497e..e69ce2f8f14e4272acf5efa4c8a252bc101227ca:/src/store/collections/collection-create-actions.ts diff --git a/src/store/collections/collection-create-actions.ts b/src/store/collections/collection-create-actions.ts index 8d1e9ba5..c7dc2ae8 100644 --- a/src/store/collections/collection-create-actions.ts +++ b/src/store/collections/collection-create-actions.ts @@ -5,6 +5,7 @@ import { Dispatch } from "redux"; import { reset, startSubmit, stopSubmit, initialize, FormErrors } from 'redux-form'; import { RootState } from '~/store/store'; +import { getUserUuid } from "~/common/getuser"; import { dialogActions } from "~/store/dialog/dialog-actions"; import { ServiceRepository } from '~/services/services'; import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service"; @@ -28,7 +29,8 @@ export const openCollectionCreateDialog = (ownerUuid: string) => const router = getState(); const properties = getState().properties; if (isItemNotInProject(properties) || !isProjectOrRunProcessRoute(router)) { - const userUuid = getState().auth.user!.uuid; + const userUuid = getUserUuid(getState()); + if (!userUuid) { return; } dispatch(initialize(COLLECTION_CREATE_FORM_NAME, { userUuid })); } else { dispatch(initialize(COLLECTION_CREATE_FORM_NAME, { ownerUuid }));