Skip to content

Commit 9dca65e

Browse files
Merge pull request #141 from ModiaSim/mo_init_with_nothing
Support Var(init=nothing, start=nothing)
2 parents b1e8ca9 + a282d02 commit 9dca65e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ModelCollections.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,15 +523,15 @@ function flattenModelTuple!(model, modelStructure, modelName, to; unitless = fal
523523
end
524524
elseif isCollection(v) && v[:_class] in [:Var] ||
525525
typeof(v) <: AbstractDict && :variable in keys(v) && v[:variable]
526-
if :init in keys(v)
526+
if :init in keys(v) && !isnothing(v[:init])
527527
x0 = v[:init]
528528
if unitless && typeof(x0) != Expr
529529
x0 = ustrip.(x0)
530530
end
531531
modelStructure.init[subMod] = x0
532532
modelStructure.mappedParameters[k] = x0
533533
end
534-
if :start in keys(v)
534+
if :start in keys(v) && !isnothing(v[:start])
535535
s0 = v[:start]
536536
if unitless && typeof(s0) != Expr
537537
s0 = ustrip.(s0)

0 commit comments

Comments
 (0)