Prevent crash when a non-existing userFcn is called from an existing library (MUSR-159)

This commit is contained in:
Bastian M. Wojek
2011-06-14 13:15:09 +00:00
parent f0d05d35cd
commit f75194750c
3 changed files with 14 additions and 1 deletions

View File

@ -1176,7 +1176,7 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map<UInt_t, TString> *co
// write FITPARAMETER block
fout << "FITPARAMETER" << endl;
fout << "# No Name Value Step Pos_Error Boundaries" << endl;
fout << "# No Name Value Step Pos_Error Boundaries" << endl;
for (i = 0; i < fParam.size(); ++i) {
if (commentsPAR) {

View File

@ -281,6 +281,18 @@ PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent) : f
tokens = 0;
}
return;
} else if (!TClass::GetDict(fUserFcnClassName.Data())) {
cerr << endl << ">> PTheory::PTheory: **ERROR** user function class '" << fUserFcnClassName.Data() << "' not found.";
cerr << endl << ">> " << fUserFcnSharedLibName.Data() << " loaded successfully, but no dictionary present.";
cerr << endl << ">> See line no " << line->fLineNo;
cerr << endl;
fValid = false;
// clean up
if (tokens) {
delete tokens;
tokens = 0;
}
return;
}
}