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 |
Method
clean_end_punctuationinmarc_export.rbthrows an exception if the value passed isnilblacklight-marc/app/models/concerns/blacklight/solr/document/marc_export.rb
Lines 493 to 498 in db85fe3
This is a problem when
chicago_citation(marc)is called with anilvalue formarc["502"]["d"]. This is the block that makes the call toclean_end_punctuationwithnilblacklight-marc/app/models/concerns/blacklight/solr/document/marc_export.rb
Lines 303 to 305 in db85fe3