From 193459ccbac4e2b069b735667b0be6afdbedbd2a Mon Sep 17 00:00:00 2001 From: Bernard Knueven Date: Mon, 2 Dec 2024 11:09:34 -0700 Subject: [PATCH] fix NoneType error --- mpisppy/utils/prox_approx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpisppy/utils/prox_approx.py b/mpisppy/utils/prox_approx.py index 8bcd898e9..0c08957d2 100644 --- a/mpisppy/utils/prox_approx.py +++ b/mpisppy/utils/prox_approx.py @@ -115,7 +115,7 @@ def add_initial_cuts_var(self, x_val, other_bound, sign, tolerance, persistent_s num_cuts += self.add_cut(x_val + sign*10*step, tolerance, persistent_solver) return num_cuts # no upper bound, or weak upper bound - if min_approx_error_pnt is None or (min_approx_error_pnt > 10*cost_pnt and cost_pnt > tolerance): + if min_approx_error_pnt is None or (cost_pnt is not None and min_approx_error_pnt > 10*cost_pnt and cost_pnt > tolerance): num_cuts += self.add_cut(x_val + sign*cost_pnt, tolerance, persistent_solver) num_cuts += self.add_cut(x_val + sign*10*cost_pnt, tolerance, persistent_solver) return num_cuts