From 154a11282a82e915bb752fc4d35fa91d599c183c Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 28 May 2024 08:15:10 +0200 Subject: [PATCH] Fix element serialization for collections that aren't populated yet Fixes https://github.com/galaxyproject/galaxy/pull/17818#issuecomment-2134060961: ``` AttributeError 'NoneType' object has no attribute 'dataset' ``` --- lib/galaxy/webapps/galaxy/services/dataset_collections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/services/dataset_collections.py b/lib/galaxy/webapps/galaxy/services/dataset_collections.py index 40d32be49e7e..52b3a37fa7f3 100644 --- a/lib/galaxy/webapps/galaxy/services/dataset_collections.py +++ b/lib/galaxy/webapps/galaxy/services/dataset_collections.py @@ -273,7 +273,7 @@ def serialize_element(dsc_element) -> DCESummary: hdca_id=self.encode_id(hdca.id), parent_id=self.encode_id(result["object"]["id"]), ) - else: + elif result["element_type"] == DCEType.hda: result["object"]["accessible"] = self.hda_manager.is_accessible(dsc_element.element_object, trans.user) return result