diff --git a/include/cantera/zeroD/ReactorBase.h b/include/cantera/zeroD/ReactorBase.h index 5f529b42c..856397f9b 100644 --- a/include/cantera/zeroD/ReactorBase.h +++ b/include/cantera/zeroD/ReactorBase.h @@ -133,10 +133,18 @@ public: //! return a reference to the contents. thermo_t& contents() { + if (!m_thermo) { + throw CanteraError("ReactorBase::contents", + "Reactor contents not defined."); + } return *m_thermo; } const thermo_t& contents() const { + if (!m_thermo) { + throw CanteraError("ReactorBase::contents", + "Reactor contents not defined."); + } return *m_thermo; } diff --git a/src/zeroD/FlowDevice.cpp b/src/zeroD/FlowDevice.cpp index 00c3bac63..20286637b 100644 --- a/src/zeroD/FlowDevice.cpp +++ b/src/zeroD/FlowDevice.cpp @@ -19,10 +19,6 @@ bool FlowDevice::install(ReactorBase& in, ReactorBase& out) // construct adapters between inlet and outlet species ThermoPhase* mixin = &m_in->contents(); ThermoPhase* mixout = &m_out->contents(); - if (mixin == 0 || mixout == 0) { - throw CanteraError("FlowDevice::install", "Can't install flow device " - "until reactor contents have been assigned."); - } m_nspin = mixin->nSpecies(); m_nspout = mixout->nSpecies();