Skip to content

Commit eab9fce

Browse files
fix: check hasname before using getname
1 parent 909aec1 commit eab9fce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/systems/abstractsystem.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,12 @@ function SymbolicIndexingInterface.is_parameter(sys::AbstractSystem, sym::Symbol
430430
if has_index_cache(sys) && (ic = get_index_cache(sys)) !== nothing
431431
return is_parameter(ic, sym)
432432
end
433-
return any(isequal(sym), getname.(parameter_symbols(sys))) ||
433+
434+
named_parameters = [getname(sym) for sym in parameter_symbols(sys) if hasname(sym)]
435+
return any(isequal(sym), named_parameters) ||
434436
count('', string(sym)) == 1 &&
435437
count(isequal(sym),
436-
Symbol.(nameof(sys), :₊, getname.(parameter_symbols(sys)))) == 1
438+
Symbol.(nameof(sys), :₊, named_parameters)) == 1
437439
end
438440

439441
function SymbolicIndexingInterface.parameter_index(sys::AbstractSystem, sym)

0 commit comments

Comments
 (0)