don't crash when msg doesn't match expected pattern.

This commit is contained in:
Eric House 2012-04-02 19:12:25 -07:00
parent 51cfbb196e
commit 2406287a34

View file

@ -132,7 +132,9 @@ public class SMSService extends Service {
String result = null;
if ( msg.startsWith( PUBLIC_HEADER ) ) {
int index = msg.lastIndexOf( " " );
result = msg.substring( index + 1 );
if ( 0 <= index ) {
result = msg.substring( index + 1 );
}
}
return result;
}