Skip to content

Exception in clean_end_punctuation #95

@hectorcorrea

Description

@hectorcorrea

Method clean_end_punctuation in marc_export.rb throws an exception if the value passed is nil

def clean_end_punctuation(text)
if [".",",",":",";","/"].include? text[-1,1]
return text[0,text.length-1]
end
text
end

This is a problem when chicago_citation(marc) is called with a nil value for marc["502"]["d"]. This is the block that makes the call to clean_end_punctuation with nil

elsif marc["502"] and (marc["502"]["b"] or marc["502"]["c"] or marc["502"]["d"]) #sometimes the dissertation note is encoded in pieces in the $b $c and $d sub fields instead of lumped into the $a
pub_info << "#{marc["502"]["b"]}, #{marc["502"]["c"]}, #{clean_end_punctuation(marc["502"]["d"])}"
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions