diff --git a/src/model.cpp b/src/model.cpp index 54363d8d1b..b671de3c73 100644 --- a/src/model.cpp +++ b/src/model.cpp @@ -883,11 +883,11 @@ void Model::setStateIsNonNegative(std::vector const& nonNegative) { // in case of conservation laws return; } - if (state_is_non_negative_.size() != gsl::narrow(nx_rdata)) { + if (nonNegative.size() != gsl::narrow(nx_rdata)) { throw AmiException( "Dimension of input stateIsNonNegative (%u) does " "not agree with number of state variables (%d)", - state_is_non_negative_.size(), nx_rdata + nonNegative.size(), nx_rdata ); } state_is_non_negative_ = nonNegative;