Skip to content

Commit

Permalink
Fix KINETIC block visitor in case there is an empty statement (#1009)
Browse files Browse the repository at this point in the history
* Avoid printing ode_rhs related code when ode_rhs is empty

Co-authored-by: Luc Grosheintz <luc.grosheintz@gmail.com>
  • Loading branch information
iomaganaris and 1uc committed Aug 30, 2023
1 parent a1a035c commit a662a45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/visitors/kinetic_block_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void KineticBlockVisitor::visit_kinetic_block(ast::KineticBlock& node) {
}
}
// divide by COMPARTMENT factor if present
if (!compartment_factors[j].empty()) {
if (!compartment_factors[j].empty() && !ode_rhs.empty()) {
ode_rhs = fmt::format("({})/({})", ode_rhs, compartment_factors[j]);
}
// if rhs of ODE is not empty, add to list of ODEs
Expand Down

0 comments on commit a662a45

Please sign in to comment.