Changeset 6479


Ignore:
Timestamp:
2004-01-14T11:42:53+13:00 (20 years ago)
Author:
jrm21
Message:

check if response.docInfo[1].metadatachildtype is not defined (even
though it should be?). Not sure what causes this behaviour, but at least
now we don't seg fault when it happens

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.cpp

    r6022 r6479  
    934934      classifytype = response.docInfo[0].metadata["childtype"].values[0];
    935935    else if (!is_top (OID)) {
    936       if (!response.docInfo[1].metadata["childtype"].values[0].empty())
    937         classifytype = response.docInfo[1].metadata["childtype"].values[0];
     936      // not sure why this is occasionally not set, but it will
     937      // cause a segfault... possibly if built with no_text? jrm21
     938      if (response.docInfo[1].metadata.find("childtype")
     939          == response.docInfo[1].metadata.end()) {
     940        cerr << "receptionist: no childtype element in metadata map!"
     941         << endl;
     942      } else {
     943        if (!response.docInfo[1].metadata["childtype"].values[0].empty())
     944          classifytype = response.docInfo[1].metadata["childtype"].values[0];
     945      }
    938946    }
    939947    browserclass *b = browsers.getbrowser (classifytype);
Note: See TracChangeset for help on using the changeset viewer.