Bug fix to the newPhase function.
This commit is contained in:
parent
6abac36cad
commit
666e688bea
1 changed files with 8 additions and 5 deletions
|
|
@ -210,14 +210,17 @@ namespace Cantera {
|
|||
ThermoPhase* newPhase(std::string infile, std::string id) {
|
||||
XML_Node* root = get_XML_File(infile);
|
||||
if (id == "-") id = "";
|
||||
XML_Node* x = get_XML_Node(string("#")+id, root);
|
||||
if (x)
|
||||
return newPhase(*x);
|
||||
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id, root);
|
||||
if (!xphase) {
|
||||
throw CanteraError("newPhase",
|
||||
"Couldn't find phase named \"" + id + "\" in file, " + infile);
|
||||
}
|
||||
if (xphase)
|
||||
return newPhase(*xphase);
|
||||
else
|
||||
return 0;
|
||||
return (ThermoPhase *) 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Import a phase specification.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue