mangstadt / ez-vcard

A vCard parser library for Java
Other
399 stars 92 forks source link

NullPointerException in VCardStringUtils.unescape #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. String test = null;
2. String result = VCardStringUtils.unescape(test);

What version of ez-vcard are you using?
0.8.0

What version of Java are you using?
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

Please provide any additional information below.
As a suggestion, I've attached a patch that checks for null input and just 
returns it unchanged to the user.

Original issue reported on code.google.com by moosemor...@googlemail.com on 12 May 2013 at 8:44

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the suggestion, but I'm going to mark this as "won't fix".  My 
experience as a Java programmer has been that you should generally avoid 
passing "null" into things unless the documentation explicitly states that you 
can.

Original comment by mike.angstadt on 13 May 2013 at 4:57

GoogleCodeExporter commented 9 years ago
Fair enough. I've written a simple wrapper method (in my own code) to do the 
null check before calling your code, which fixes my problem. Thanks for the 
response :)

Original comment by moosemor...@googlemail.com on 13 May 2013 at 9:01

GoogleCodeExporter commented 9 years ago
np thx

Original comment by mike.angstadt on 14 May 2013 at 12:08