do {
final String fromNumber=cursor.getString(1);
final String from;
- final String name=Utils.callerId(context, Utils.toNonNull(fromNumber));
- if(name==null)
- from=fromNumber;
- else
- from=fromNumber+" ("+name+')';
+ if(fromNumber == null)
+ from = null;
+ else {
+ final String name=Utils.callerId(context, Utils.toNonNull(fromNumber));
+ if(name==null)
+ from=fromNumber;
+ else
+ from=fromNumber+" ("+name+')';
+ }
+
final String message=cursor.getString(2).replace("\n", "\n ");
final Date date=new Date(cursor.getLong(3));