In Document Author section the assigned person and representedOrganization is not handled properly my code is getting crash in case where i have below data in author.
<author typeCode="AUT" contextControlCode="OP"> <time value="20170301045443.991-0500"/> <assignedAuthor classCode="ASSIGNED"> <id nullFlavor="NI"/> <addr nullFlavor="UNK"/> <telecom nullFlavor="UNK"/> <assignedPerson> <name>Auto Generated</name> </assignedPerson> <representedOrganization> <name>ABCD</name> <telecom nullFlavor="UNK"/> <addr nullFlavor="UNK"/> </representedOrganization> </assignedAuthor> </author>
the code for handling this :
` var name_dict = parseName(el);
// Sometimes C32s include names that are just like String
// and we still want to get something out in that case
if (!name_dict.prefix && !name_dict.given && !name_dict.given.length && !name_dict.family) {
name_dict.family = el.val();
}`
It is breaking at if condition
kindly suggest.
In Document Author section the assigned person and representedOrganization is not handled properly my code is getting crash in case where i have below data in author.
<author typeCode="AUT" contextControlCode="OP"> <time value="20170301045443.991-0500"/> <assignedAuthor classCode="ASSIGNED"> <id nullFlavor="NI"/> <addr nullFlavor="UNK"/> <telecom nullFlavor="UNK"/> <assignedPerson> <name>Auto Generated</name> </assignedPerson> <representedOrganization> <name>ABCD</name> <telecom nullFlavor="UNK"/> <addr nullFlavor="UNK"/> </representedOrganization> </assignedAuthor> </author>the code for handling this :
` var name_dict = parseName(el);
// Sometimes C32s include names that are just like String
// and we still want to get something out in that case
if (!name_dict.prefix && !name_dict.given && !name_dict.given.length && !name_dict.family) {
name_dict.family = el.val();
}`
It is breaking at if condition
kindly suggest.