Skip to content

Commit a85d6b7

Browse files
committed
Prevent running into error associated with sum of nothing
1 parent d7ee9c1 commit a85d6b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Simulation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ calculate the rates of all reactions at time t
636636
function rates(ssys::Q,t::X) where {Q<:SystemSimulation,X<:Real}
637637
rts = zeros(length(ssys.reactions))
638638
domains = getfield.(ssys.sims,:domain)
639-
Nrxns = sum([length(sim.domain.phase.reactions) for sim in ssys.sims])+sum([length(inter.reactions) for inter in ssys.interfaces if hasproperty(inter,:reactions)])
639+
Nrxns = sum([length(sim.domain.phase.reactions) for sim in ssys.sims])+sum([hasproperty(inter,:reactions) ? length(inter.reactions) : 0 for inter in ssys.interfaces])
640640
Nspcs = sum([length(sim.domain.phase.species) for sim in ssys.sims])
641641
cstot = zeros(Nspcs)
642642
vns = Array{Any,1}(undef,length(domains))

0 commit comments

Comments
 (0)