From 8b9734fffef0438213f024414faaf28bd34434b1 Mon Sep 17 00:00:00 2001 From: "nicolas.wenk" Date: Tue, 9 Jun 2026 13:03:34 +0200 Subject: [PATCH] Support files with no "EVENT" in their parameters --- gaitalytics/io.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gaitalytics/io.py b/gaitalytics/io.py index 8d727a3..0dbd730 100644 --- a/gaitalytics/io.py +++ b/gaitalytics/io.py @@ -219,9 +219,10 @@ def _get_sections(self, section_base): A list containing the sections of the specified type. """ sections = [] - for section in self._c3d["parameters"]["EVENT"].keys(): - if section.startswith(section_base): - sections.append(section) + if "parameters" in self._c3d and "EVENT" in self._c3d["parameters"]: + for section in self._c3d["parameters"]["EVENT"].keys(): + if section.startswith(section_base): + sections.append(section) return sections def _concat_sections(self, section_base: str) -> list: