Skip to content

Commit

Permalink
Check if user is not null before accessing user attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Sep 25, 2023
1 parent b57d6ed commit 4256d87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4256d87

Please sign in to comment.