The objective function `Val{false}()` is not supported by JuMP

Hi, I am trying to build a NHL DFS lineup optimizer using code found at https://github.com/dscotthunter/Fantasy-Hockey-IP-Code/blob/master/code_for_Github.jl which needs updated for the current version of JuMP. I’m very new to Julia and JuMP but I’ve had some success working on it until I got stuck at the following error:

 [1] set_objective(::Model, ::MathOptInterface.OptimizationSense, ::Val{false}) at /home/greg/.julia/packages/JuMP/iGamg/src/objective.jl:101
 [2] one_lineup_Type_4(::DataFrame, ::DataFrame, ::Array{Int64,2}, ::Int64, ::Int64, ::Int64, ::Array{Int64,1}, ::Array{Int64,1}, ::Array{Int64,1}, ::Int64, ::LinearAlgebra.Adjoint{Int64,Array{Int64,1}}, ::Array{Any,1}, ::Array{Int64,2}, ::Int64, ::Array{Int64,1}) at /home/greg/.julia/packages/JuMP/iGamg/src/macros.jl:979
 [3] create_lineups(::Int64, ::Int64, ::String, ::String, ::typeof(one_lineup_Type_4), ::String) at /data/Projects/Sports/NHL/lineupoptimizer.jl:265
 [4] top-level scope at /data/Projects/Sports/NHL/lineupoptimizer.jl:332
 [5] include at ./boot.jl:328 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1094
 [7] include(::Module, ::String) at ./Base.jl:31
 [8] include(::String) at ./client.jl:431
 [9] top-level scope at REPL[1]:1
in expression starting at /data/Projects/Sports/NHL/lineupoptimizer.jl:332

The objective function I’m using is:

@objective(m, Max, sum(skaters[i,:Projection]*skaters_lineup[i] for i=1:num_skaters) + sum(goalies[i,:Projection]*goalies_lineup[i] for i=1:num_goalies))

The full code is at https://github.com/TheNextMyth/Fantasy-Hockey-IP-Code/blob/master/lineupoptimizer.jl and also has the csv files I was using for testing.

I believe there is something wrong with the objective function formula I am passing in but am not sure. Any help is appreciated. Please let me know what other information I need to include or if I made some other posting mistake. Thank you.

Aren’t num_skaters and num_goalies equal to zero ?
I can reproduce it with

julia> using JuMP

julia> model = Model()
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> @objective(model, Max, sum(1 for i in 1:0))
ERROR: The objective function `Val{false}()` is not supported by JuMP.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] set_objective(::Model, ::MathOptInterface.OptimizationSense, ::Val{false}) at /home/blegat/.julia/packages/JuMP/iGamg/src/objective.jl:101
 [3] top-level scope at /home/blegat/.julia/packages/JuMP/iGamg/src/macros.jl:979

I just reported the unhelpful error message in https://github.com/JuliaOpt/JuMP.jl/issues/2087

Here is where I thought I was assigning num_skaters and num_goalies

    # Load information for skaters table
    skaters = CSV.read(path_skaters)

    # Load information for goalies table
    goalies = CSV.read(path_goalies)

    # Number of skaters
    num_skaters = size(skaters)[1]

    # Number of goalies
    num_goalies = size(goalies)[1]