Skip to content

Commit

Permalink
Merge pull request #365 from zontal/bug/NoneType
Browse files Browse the repository at this point in the history
Bug/none type
  • Loading branch information
tristan-ranff committed May 10, 2024
2 parents d74fef7 + a51022b commit 95e1f14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymzml/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,9 @@ def scan_time(self):
scan_time_ele = self.element.find(
".//*[@accession='MS:1000016']".format(ns=self.ns)
)
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 95e1f14

Please sign in to comment.