PenguinPaul/google-voice-java

Empty Sms Inbox breaks the parser

Opened this issue · 6 comments

What steps will reproduce the problem?
1. Create a brand new google voice account, and ensure no text messages are 
sent to the account before part 2 and 3.
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?

An empty sms thread.  The program crashes instead.


What version of the product are you using? On what operating system?

Changeset 137 on mac os x 10.6 and ubuntu.



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

I have a patch that will fix this issue, once I can commit.

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

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

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

  • Changed state: Started
Hi there,

I did a simple patch to fix it:

String text = "";
                try {
                    text = element
                            .selectSingleNode(XPathQuery.MESSAGE_SMS_TEXT)
                            .getText().trim();
                } catch (NullPointerException npe) {
                }

Original comment by pjnomo...@gmail.com on 16 Oct 2011 at 7:24

Please find attached a one-line fix to the problem against SVN r173

Original comment by bait...@gmail.com on 21 Feb 2012 at 7:04

Attachments:

OK so can I close this issue, has the fix gone into the trunk?

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