tdelenikas / smslib

SMSLib v4
Apache License 2.0
110 stars 97 forks source link

NullPointerException in MessageReader #15

Closed drenda closed 8 years ago

drenda commented 8 years ago

Hi, I found a NullPointerException in MessageReader. This is the stack trace:

java.lang.NullPointerException
        at org.smslib.gateway.modem.MessageReader.parsePDU(MessageReader.java:103) ~[smslib-dev-SNAPSHOT.jar!/:?]
        at org.smslib.gateway.modem.MessageReader.run(MessageReader.java:67) [smslib-dev-SNAPSHOT.jar!/:?]
(END)

I think that is enough to check if reader.readLine() is not null.

Thanks

tdelenikas commented 8 years ago

I don't have any logs to review, but the line there should not be null...

Are you saying that if the line is null, skip it and read the next? Have you tested that approach? What modem are you using?

drenda commented 8 years ago

I'm using a Wavecom M1306 Usb. Yes I'm saying exactly whay you told. I had no way to try it.

I had this exception in very very rare occasions so is not simple understand why it happened.