00d / google-voice-java

Automatically exported from code.google.com/p/google-voice-java
0 stars 0 forks source link

Empty Sms Message Body Breaks the Parser #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using any google voice account, send a message with an empty body (not even 
spaces) to the account.
2. Connect to the account with google-voice-java.
3. Call the getSMSThreads() method in the Voice class.
4. Weep as you get a null pointer exception.

What is the expected output? What do you see instead?
I would expect to get an sms thread with a single sms that had no text in the 
body of the message.  I get a null pointer exception instead.

What version of the product are you using? On what operating system?
Changeset 137 on mac osx 10.6 and ubuntu linux.

Original issue reported on code.google.com by walt.jav...@gmail.com on 4 Mar 2011 at 11:03

GoogleCodeExporter commented 9 years ago
I have a patch that fixes this as well as a junit test case to ensure it 
doesn't break in the future.

Currently there isn't a test suite for this project... so I won't force it, if 
folks don't care.  But if there is interest in beginning to unit test, I'd 
contribute to the cause.

Original comment by walt.jav...@gmail.com on 4 Mar 2011 at 11:13

GoogleCodeExporter commented 9 years ago

Original comment by walt.jav...@gmail.com on 22 Mar 2011 at 6:12

GoogleCodeExporter commented 9 years ago

Original comment by walt.jav...@gmail.com on 22 Mar 2011 at 6:13

GoogleCodeExporter commented 9 years ago
Hi Walt, I wanted to check on the status of this one as well.

Original comment by malone.j...@gmail.com on 3 Feb 2012 at 3:48

GoogleCodeExporter commented 9 years ago
Replace SMSParser.java line 178:

String text = 
element.selectSingleNode(XPathQuery.MESSAGE_SMS_TEXT).getText().trim();

With:

String text = "";
 if (element.selectSingleNode(XPathQuery.MESSAGE_SMS_TEXT) != null) {
     text = element.selectSingleNode(XPathQuery.MESSAGE_SMS_TEXT).getText().trim();
 }

Original comment by natecmic...@gmail.com on 23 Mar 2012 at 4:13

GoogleCodeExporter commented 9 years ago
Nate, your fix has been committed.  I would love to hear again from Walt about 
his patch and test cases.

Original comment by malone.j...@gmail.com on 25 Mar 2012 at 2:03

GoogleCodeExporter commented 9 years ago
Can I close this issue?

Original comment by malone.j...@gmail.com on 14 May 2012 at 3:39