diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index 856a76e2fa1ca360b278baaf95df3ffdfe8cc14e..8e2462362742d76cd253b5a13589b3fd77060931 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -117,6 +117,7 @@ std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, doub
 		denumerator += dx * dx;
 	}
 
+	if(denumerator==0.0) denumerator=1e-6;
 	const double slope    = numerator / denumerator;
 	const double position = meany - slope * meanx;