Fixed a segfault when supplied with a null pointer.

This commit is contained in:
Harry Moffat 2008-08-27 00:01:21 +00:00
parent a25f41e605
commit f650649725

View file

@ -44,8 +44,13 @@ namespace Cantera {
m_waterIAPWS(0),
m_own_sub(false)
{
m_waterIAPWS = wptr->getWater();
m_own_sub = false;
if (wptr) {
m_waterIAPWS = wptr->getWater();
m_own_sub = false;
} else {
m_waterIAPWS = new WaterPropsIAPWS();
m_own_sub = true;
}
}
/**