17098: Fixes unit test for refactored menu kind function.
[arvados-workbench2.git] / src / store / resources / resources.ts
index eb3c5509f2f1c3f99c2afc028c4ae18e7e308b6c..696a136280c1a72fef39a8a204e5fd9557439508 100644 (file)
@@ -31,6 +31,8 @@ const getResourceWritableBy = (state: ResourcesState, id: string, userUuid: stri
 
 export const getResourceWithEditableStatus = <T extends EditableResource & GroupResource>(id: string, userUuid?: string) =>
     (state: ResourcesState): T | undefined => {
+        if (state[id] === undefined) { return; }
+
         const resource = JSON.parse(JSON.stringify(state[id] as T));
 
         if (resource) {