Fix opening info dialog from MainActivity when DB is not operational

This commit is contained in:
xynngh 2020-06-12 16:40:02 +04:00
parent 693bd02f30
commit 0b633ce5d1
1 changed files with 6 additions and 3 deletions

View File

@ -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;