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: