Skip to content

Commit

Permalink
Don't upchuck an NPE if a metadata value is null
Browse files Browse the repository at this point in the history
  • Loading branch information
mwoodiupui committed Oct 16, 2013
1 parent 39702c9 commit 7ba9088
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,13 @@ private static String formatMetadata(Map<String, String> raw)

/**
* Percent-encode a few EZID-specific characters.
*
* @return null for null input.
*/
private static String escape(String s)
{
if (null == s) { return s; }

return s.replace("%", "%25")
.replace("\n", "%0A")
.replace("\r", "%0D")
Expand Down

0 comments on commit 7ba9088

Please sign in to comment.