Skip to content

Commit 7c62e3a

Browse files
fix: handle problems with no system in SavedSubsystem constructor
1 parent bf913e7 commit 7c62e3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/solutions/save_idxs.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ function as_diffeq_array(vt::Vector{VectorTemplate}, t)
4444
return DiffEqArray(typeof(TupleOfArraysWrapper(vt))[], t, (1, 1))
4545
end
4646

47+
function is_empty_indp(indp)
48+
isempty(variable_symbols(indp)) && isempty(parameter_symbols(indp)) &&
49+
isempty(independent_variable_symbols(indp))
50+
end
51+
4752
"""
4853
$(TYPEDSIGNATURES)
4954
@@ -104,6 +109,12 @@ function SavedSubsystem(indp, pobj, saved_idxs)
104109
return nothing
105110
end
106111

112+
# this is required because problems with no system have an empty `SymbolCache`
113+
# as their symbolic container.
114+
if is_empty_indp(indp)
115+
return nothing
116+
end
117+
107118
# array state symbolics must be scalarized
108119
saved_idxs = collect(Iterators.flatten(map(saved_idxs) do sym
109120
if symbolic_type(sym) == NotSymbolic()

0 commit comments

Comments
 (0)