From 4cbdf81e5bb70a6d8e681d191edf4b35cccea427 Mon Sep 17 00:00:00 2001 From: Mingfei Shao Date: Tue, 22 Oct 2024 15:08:25 -0500 Subject: [PATCH] better code --- src/pfb/importers/gen3dict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pfb/importers/gen3dict.py b/src/pfb/importers/gen3dict.py index 6e5c251..052c156 100644 --- a/src/pfb/importers/gen3dict.py +++ b/src/pfb/importers/gen3dict.py @@ -275,7 +275,7 @@ def _array_type(property_type): if "description" in property_type: enum["name"] = property_type["description"] else: - enum["name"] = property_type["term"]["termDef"]["term"] + enum["name"] = property_type.get("term", {}).get("termDef", {}).get("term") if enum["name"] is None: # This final fallback is to a value that was being used before enum["name"] = property_type["termDef"][0]["term"]