diff --git a/pymzml/run.py b/pymzml/run.py
index 1dfddf0..0f35075 100755
--- a/pymzml/run.py
+++ b/pymzml/run.py
@@ -336,6 +336,8 @@ class Reader(object):
             ElementTree.iterparse(self.info["file_object"], events=("end", "start"))
         )  # NOTE: end might be sufficient
         _, self.root = next(mzml_iter)
+        self.info["chromatogram_count"] = None
+        self.info["spectrum_count"] = None
         while True:
             event, element = next(mzml_iter, ("END", "END"))
             if element.tag.endswith("}mzML"):
@@ -365,9 +367,7 @@ class Reader(object):
                 break
             elif element.tag.endswith("}chromatogramList"):
                 chrom_cnt = element.attrib.get("count", None)
-                if chrom_cnt is None:
-                    self.info["chromatogram_count"] = None
-                else:
+                if chrom_cnt:
                     self.info["chromatogram_count"] = int(chrom_cnt)
                 break
             elif element.tag.endswith("}run"):

Method pymzml.run.Reader.get_chromatogram_count() does not return chromatogram count
**Describe the bug**

[pymzml.run.Reader.get_chromatogram_count()](https://pymzml.readthedocs.io/en/latest/pymzml_run.html#pymzml.run.Reader.get_chromatogram_count) throws a `KeyError KeyError: 'chromatogram_count'` when I try to get the chromatogram count for the exemplary data [tests/data/example.mzML](https://github.com/pymzml/pymzML/blob/master/tests/data/example.mzML).

**To Reproduce**

With the data file data example.mzML in the same directory as a Jupyter notebook with following cell:

````
import pymzml
import os

current_dir = os.getcwd()
mzml_file_path = current_dir + '/example.mzML'
reader = pymzml.run.Reader( mzml_file_path )
reader.get_chromatogram_count()
````

throws

````
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-36-46dfe74fa1c6> in <module>
----> 1 reader.get_chromatogram_count()

/usr/local/lib/python3.6/dist-packages/pymzml/run.py in get_chromatogram_count(self)
    405             chromatogram count (int): Number of chromatograms in file.
    406         """
--> 407         return self.info["chromatogram_count"]
    408 
    409 

KeyError: 'chromatogram_count'
````

**Expected behavior**

Either (a) count of chromatograms or (b) human readable exception message about API miss-use.

**Screenshots**

n.a.

**Desktop (please complete the following information):**
 - OS: Ubuntu, Docker CE, Docker Container created from [Docker image tensorflow/tensorflow](https://hub.docker.com/r/tensorflow/tensorflow/) with tag `latest-py3-jupyter`
 - Version: `pymzml==2.4.0`

**Additional context**

n.a.

diff --git a/tests/main_reader_test.py b/tests/main_reader_test.py
index 0d163f2..eabe7a4 100755
--- a/tests/main_reader_test.py
+++ b/tests/main_reader_test.py
@@ -187,13 +187,17 @@ class runTest(unittest.TestCase):
 
     def test_get_spec_count(self):
         self.assertEqual(self.reader_compressed_indexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_compressed_indexed.getChromatogramCount(), 1) # Failing
         self.assertEqual(self.reader_compressed_unindexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_compressed_unindexed.getChromatogramCount, 1) # Failing
         self.assertEqual(self.reader_uncompressed_unindexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_uncompressed_unindexed.getChromatogramCount(), 1) # Failing
         self.assertEqual(self.reader_uncompressed_unindexed.get_spectrum_count(), 2918)
-        # self.assertEqual(self.reader_uncompressed_ununindexed.getChromatogramCount(), 1) # Failing
+
+    def test_chrom_count_chrom_file(self):
+        reader = run.Reader(self.paths[3])
+        self.assertEqual(reader.get_chromatogram_count(), 3)
+
+    def test_chrom_count_spec_file(self):
+        reader = run.Reader(self.paths[0])
+        self.assertEqual(reader.get_chromatogram_count(), None)
 
     def test_readers_remeber_spawned_spectra(self):
         """

pip install -e .[full]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc g++
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
brain-isotopic-distribution==1.5.17
certifi==2025.1.31
charset-normalizer==3.4.1
dill==0.3.9
exceptiongroup==1.2.2
greenlet==3.1.1
idna==3.10
iniconfig==2.1.0
lxml==5.3.1
ms_deisotope==0.0.9
ms_peak_picker==0.1.46
narwhals==1.32.0
numpy==2.0.2
packaging==24.2
plotly==1.13.0
pluggy==1.5.0
psims==1.3.5
-e git+https://github.com/pymzml/pymzML.git@0221a5c9c490bdd97787dc4d37346c831dcfa141#egg=pymzml
pynumpress==0.0.9
pyteomics==4.7.5
pytest==8.3.5
pytz==2025.2
regex==2024.11.6
requests==2.32.3
scipy==1.13.1
six==1.17.0
SQLAlchemy==2.0.40
tomli==2.2.1
typing_extensions==4.13.0
urllib3==2.3.0

name: pymzML
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - brain-isotopic-distribution==1.5.17
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - dill==0.3.9
      - exceptiongroup==1.2.2
      - greenlet==3.1.1
      - idna==3.10
      - iniconfig==2.1.0
      - lxml==5.3.1
      - ms-deisotope==0.0.9
      - ms-peak-picker==0.1.46
      - narwhals==1.32.0
      - numpy==2.0.2
      - packaging==24.2
      - plotly==1.13.0
      - pluggy==1.5.0
      - psims==1.3.5
      - pynumpress==0.0.9
      - pyteomics==4.7.5
      - pytest==8.3.5
      - pytz==2025.2
      - regex==2024.11.6
      - requests==2.32.3
      - scipy==1.13.1
      - six==1.17.0
      - sqlalchemy==2.0.40
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - urllib3==2.3.0
prefix: /opt/conda/envs/pymzML

tests/main_reader_test.py::runTest::test_chrom_count_spec_file
tests/main_reader_test.py::runTest::test_chrom_count_chrom_file tests/main_reader_test.py::runTest::test_determine_file_encoding tests/main_reader_test.py::runTest::test_get_spec_count tests/main_reader_test.py::runTest::test_init_iter tests/main_reader_test.py::runTest::test_next tests/main_reader_test.py::runTest::test_readers_remeber_spawned_spectra
pymzml/run.py
pymzml/run.py