Document::getField can not handle unkown field ?
Zhi-Wei Huang
zwhuang at gmail.com
Wed Oct 29 10:36:25 EDT 2008
Hi,
I use python method
bib = doc.get_field('bibitem')
to get string from a document entry, but Referencer crashes and shows
the debug info
Document::getField: WARNING: unknown field 'bibitem'
Then I view Document.C and see
Document::getField
get field from bib block, and returns strings for all known fields.
However, for unknown field, there is only a line of DEBUG info, no
string is returned, even an empty string "".
I change the code and compile the project, it works now. So I think
that may be a bug. I'm not sure, :).
The diff info is here:
===============================================
--- a/src/Document.C Tue Oct 28 17:40:27 2008 +0000
+++ b/src/Document.C Wed Oct 29 22:21:32 2008 +0800
@@ -714,6 +714,7 @@
return bib_.extras_[_field];
} else {
DEBUG1 ("Document::getField: WARNING: unknown field %1", field);
+ return "";
}
}
}
===============================================
Best regards,
Huang
More information about the referencer
mailing list