From ab2beb4c64c30e2352dcb7f84506e55d0b999870 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 28 Feb 2015 00:24:38 +0000 Subject: [PATCH] [Reactor] Check that contents are assigned before starting integration --- src/zeroD/Reactor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zeroD/Reactor.cpp b/src/zeroD/Reactor.cpp index 0796c32d6..8dbcdf0cf 100644 --- a/src/zeroD/Reactor.cpp +++ b/src/zeroD/Reactor.cpp @@ -67,6 +67,10 @@ void Reactor::getSurfaceInitialConditions(double* y) void Reactor::initialize(doublereal t0) { + if (!m_thermo || !m_kin) { + throw CanteraError("Reactor::initialize", "Reactor contents not set" + " for reactor '" + m_name + "'."); + } m_thermo->restoreState(m_state); m_sdot.resize(m_nsp, 0.0); m_wdot.resize(m_nsp, 0.0);