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