diff --git a/src/pyxdf/pyxdf.py b/src/pyxdf/pyxdf.py
index fc82733..72b6c6c 100644
--- a/src/pyxdf/pyxdf.py
+++ b/src/pyxdf/pyxdf.py
@@ -689,7 +689,7 @@ def _truncate_corrupted_offsets(temp, streams):
for stream_id, stream in temp.items():
# First check if there are extra samples - this is the primary evidence
# of a potential pylsl#67, liblsl#246 bug.
- footer = streams.get(stream_id, {}).get("footer", {}).get("info", {})
+ footer = streams.get(stream_id, {}).get("footer", {}).get("info") or {}
sample_count_str = footer.get("sample_count", [None])[0]
if sample_count_str is None:
continue
diff --git a/test/test_truncate_corrupted_offsets.py b/test/test_truncate_corrupted_offsets.py
index 574ddbd..0ac7a16 100644
--- a/test/test_truncate_corrupted_offsets.py
+++ b/test/test_truncate_corrupted_offsets.py
@@ -188,3 +188,25 @@ def test_truncation_of_samples_and_corrupted_clock_offset():
expected_timestamps,
atol=1e-6,
)
+
+
+def test_no_crash_when_footer_info_is_none():
+ """Streams with empty footer info (None) should be skipped gracefully.
+
+ _xml2dict returns {"info": None} for empty XML elements like
+ or . This must not crash _truncate_corrupted_offsets.
+ """
+ temp = {
+ 1: MockStreamData(time_stamps=np.linspace(0, 100, 100)),
+ 2: MockStreamData(time_stamps=np.linspace(0, 50, 50)),
+ }
+ streams = {
+ 1: {"footer": {"info": {"sample_count": ["100"]}}},
+ 2: {"footer": {"info": None}},
+ }
+
+ # Should not raise AttributeError
+ result = _truncate_corrupted_offsets(temp, streams)
+
+ # Stream 2 should be unchanged
+ assert len(result[2].time_stamps) == 50