From 4256d87b80f29f9529e62f6acf4b6d81ec32cf07 Mon Sep 17 00:00:00 2001 From: John Davis Date: Mon, 25 Sep 2023 12:11:00 -0400 Subject: [PATCH] Check if user is not null before accessing user attribute --- lib/galaxy/webapps/galaxy/api/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 1b60d2a516ed..2523819056d8 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -192,7 +192,7 @@ def show(self, trans: GalaxyWebTransaction, id, **kwd): """ stored_workflow = self.__get_stored_workflow(trans, id, **kwd) if stored_workflow.importable is False and stored_workflow.user != trans.user and not trans.user_is_admin: - wf_count = trans.user.count_stored_workflow_user_assocs(stored_workflow) + wf_count = 0 if not trans.user else trans.user.count_stored_workflow_user_assocs(stored_workflow) if wf_count == 0: message = "Workflow is neither importable, nor owned by or shared with current user" raise exceptions.ItemAccessibilityException(message)