Skip to content

Commit

Permalink
fix NoneType error
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Dec 2, 2024
1 parent d202af2 commit 193459c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mpisppy/utils/prox_approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 193459c

Please sign in to comment.