Fix opening info dialog from MainActivity when DB is not operational
This commit is contained in:
parent
693bd02f30
commit
0b633ce5d1
|
@ -222,9 +222,12 @@ public class MainActivity extends AppCompatActivity {
|
|||
List<CallLogItem> items = CallLogHelper.getRecentCalls(MainActivity.this, 20);
|
||||
|
||||
for (CallLogItem item : items) {
|
||||
item.numberInfo = DatabaseSingleton.getCommunityDatabase().isOperational()
|
||||
? DatabaseSingleton.getNumberInfo(item.number)
|
||||
: new NumberInfo();
|
||||
if (DatabaseSingleton.getCommunityDatabase().isOperational()) {
|
||||
item.numberInfo = DatabaseSingleton.getNumberInfo(item.number);
|
||||
} else {
|
||||
item.numberInfo = new NumberInfo();
|
||||
item.numberInfo.number = item.number;
|
||||
}
|
||||
}
|
||||
|
||||
return items;
|
||||
|
|
Loading…
Reference in New Issue