Skip to content

Commit

Permalink
Fix: AttributeError: 'NoneType' object has no attribute 'attrib'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangcolsman committed May 7, 2024
1 parent a14f98b commit a51022b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymzml/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,9 @@ def scan_time(self):
scan_time_ele = self.element.find(
".//*[@accession='MS:1000016']".format(ns=self.ns)
)
if scan_time_ele is not None:
self._scan_time = float(scan_time_ele.attrib.get("value"))
self._scan_time_unit = scan_time_ele.get("unitName", "unicorns")
if scan_time_ele is not None:
self._scan_time = float(scan_time_ele.attrib.get("value"))
self._scan_time_unit = scan_time_ele.get("unitName", "unicorns")
return self._scan_time, self._scan_time_unit

# @property
Expand Down

0 comments on commit a51022b

Please sign in to comment.