Skip to content

Commit 7b49496

Browse files
committed
check that disjunction is not empty
1 parent e1bfb33 commit 7b49496

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/macros.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Add disjunction and reformulate.
8585
function add_disjunction!(m::Model,disj...;reformulation::Symbol,M=missing=1e-6,name=missing)
8686
#run checks
8787
@assert reformulation in [:big_m, :hull] "Invalid reformulation method passed to keyword argument `:reformulation`. Valid options are :big_m (Big-M Reformulation) and :hull (Hull Reformulation)."
88+
@assert !all(isnothing.(disj)) "Must have at least 1 disjunct that is not `nothing`."
8889
# @assert length(disj) > 1 "At least 2 disjuncts must be included. If there is an empty disjunct, use `nothing`."
8990

9091
#create indicator variable

0 commit comments

Comments
 (0)