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

Empty Sms Message Body Breaks the Parser #19

Open
GoogleCodeExporter opened this issue Apr 11, 2015 · 7 comments
Open

Empty Sms Message Body Breaks the Parser #19

GoogleCodeExporter opened this issue Apr 11, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Can I close this issue?

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

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

No branches or pull requests

1 participant