Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in clean_end_punctuation #95

Open
hectorcorrea opened this issue Sep 2, 2021 · 0 comments
Open

Exception in clean_end_punctuation #95

hectorcorrea opened this issue Sep 2, 2021 · 0 comments

Comments

@hectorcorrea
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant