diff --git a/raytracing/imagingpath.py b/raytracing/imagingpath.py
index 6c89bff..b9ee7de 100644
--- a/raytracing/imagingpath.py
+++ b/raytracing/imagingpath.py
@@ -260,6 +260,9 @@ class ImagingPath(MatrixGroup):
         A = transferMatrixToApertureStop.A
         B = transferMatrixToApertureStop.B
 
+        if transferMatrixToApertureStop.isImaging:
+            return None
+
         thetaUp  = (stopDiameter / 2.0 - A * y) / B
         thetaDown = (-stopDiameter / 2.0 - A * y) / B
 

diff --git a/raytracing/tests/testsImagingPath.py b/raytracing/tests/testsImagingPath.py
index 2e24ab7..be8f0e1 100644
--- a/raytracing/tests/testsImagingPath.py
+++ b/raytracing/tests/testsImagingPath.py
@@ -61,6 +61,11 @@ class TestImagingPath(unittest.TestCase):
         chiefRay = path.chiefRay()
         self.assertIsNone(chiefRay)
 
+    def testMarginalRaysIsImaging(self):
+        path = ImagingPath(System4f(10, 10))
+        path.append(Aperture(10))
+        self.assertIsNone(path.marginalRays())
+
     def testImageSizeDIs0(self):
         path = ImagingPath(System2f(f=10, diameter=10))
         path.append(Aperture(20))

ImagingPath: division by 0 in marginalRays
When we have an `ImagingPath` that has a transfer matrix to the aperture stop with `B == 0`, there is a division by 0 in the calculations of theta + and -. We should check when it's the case and return `None`.
raytracing/tests/testsImagingPath.py::TestImagingPath::testMarginalRaysIsImaging
raytracing/tests/testsImagingPath.py::TestImagingPath::testChiefRayNoApertureStop raytracing/tests/testsImagingPath.py::TestImagingPath::testDisplayRangeWithEmptyPath raytracing/tests/testsImagingPath.py::TestImagingPath::testDisplayRangeWithFiniteLens raytracing/tests/testsImagingPath.py::TestImagingPath::testDisplayRangeWithObjectHigherThanLens raytracing/tests/testsImagingPath.py::TestImagingPath::testEntrancePupilAIs0 raytracing/tests/testsImagingPath.py::TestImagingPath::testImageSizeDIs0 raytracing/tests/testsImagingPath.py::TestImagingPath::testImagingPathInfiniteFieldOfView raytracing/tests/testsImagingPath.py::TestImagingPath::testImagingPathInfiniteFieldOfView2 raytracing/tests/testsImagingPath.py::TestImagingPath::testImagingPathInfiniteFieldOfView3