Skip to content

Commit 99b0138

Browse files
Update src/systems/model_parsing.jl
Co-authored-by: Fredrik Bagge Carlson <[email protected]>
1 parent eff05fb commit 99b0138

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/systems/model_parsing.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ singular(sym) = last(string(sym)) == 's' ? Symbol(string(sym)[1:(end - 1)]) : sy
286286

287287
function check_name_uniqueness(dict, a, newvarclass)
288288
for varclass in [:variables, :parameters, :structural_parameters, :constants]
289-
if haskey(dict, varclass) && a in keys(dict[varclass])
289+
dvarclass = get(dict, varclass, nothing)
290+
if dvarclass !== nothing && a in keys(dvarclass)
290291
error("Cannot create a $(singular(newvarclass)) `$(a)` because there is already a $(singular(varclass)) with that name")
291292
end
292293
end

0 commit comments

Comments
 (0)