Fixed a segfault when supplied with a null pointer.
This commit is contained in:
parent
a25f41e605
commit
f650649725
1 changed files with 7 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue