Simplified test for missing solution.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@2077 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2007-06-15 19:46:31 +00:00
parent 0bebfae5a5
commit b2dd9ad8d1

View File

@ -101,15 +101,17 @@ cxxNumKeyword()
std::map<int, double>::const_iterator it;
for (it = mixcomps->begin(); it != mixcomps->end(); it++)
{
const cxxSolution *cxxsoln_ptr1 = &(solutions.find(it->first)->second);
if (cxxsoln_ptr1 == NULL)
std::map<int, cxxSolution>::const_iterator sol = solutions.find(it->first);
if (sol == solutions.end())
{
sprintf(error_string, "Solution %d not found in mix_cxxSolutions.", it->first);
error_msg(error_string, CONTINUE);
input_error++;
return;
}
this->add(*cxxsoln_ptr1, it->second);
} else
{
const cxxSolution *cxxsoln_ptr1 = &(sol->second);
this->add(*cxxsoln_ptr1, it->second);
}
}
}