Skip to content

Commit

Permalink
Avoid assigning Nothing type bc expects Float
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Becker committed Jun 27, 2024
1 parent 198eb0a commit 9912048
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion julia_src/http.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ function chp_defaults(req::HTTP.Request)
# Process .json inputs and convert to correct type if needed
for k in all_vals
if !haskey(d, k)
d[k] = nothing
if !(k == "thermal_efficiency") # thermal_efficiency is of type Float64 (incl NaN), so it can't be "nothing"
d[k] = nothing
end
elseif !isnothing(d[k])
if k in float_vals && typeof(d[k]) == String
d[k] = parse(Float64, d[k])
Expand Down

0 comments on commit 9912048

Please sign in to comment.