mirror of
https://github.com/etesync/android
synced 2024-11-16 04:49:06 +00:00
Don't crash when immediately entering collection after creation.
This commit is contained in:
parent
eae4e14b1d
commit
26c0a62dc4
@ -237,6 +237,9 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh
|
|||||||
if (info.type == CollectionInfo.Type.CALENDAR) {
|
if (info.type == CollectionInfo.Type.CALENDAR) {
|
||||||
try {
|
try {
|
||||||
LocalCalendar resource = LocalCalendar.findByName(account, getContentResolver().acquireContentProviderClient(CalendarContract.CONTENT_URI), LocalCalendar.Factory.INSTANCE, info.uid);
|
LocalCalendar resource = LocalCalendar.findByName(account, getContentResolver().acquireContentProviderClient(CalendarContract.CONTENT_URI), LocalCalendar.Factory.INSTANCE, info.uid);
|
||||||
|
if (resource == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
count = resource.count();
|
count = resource.count();
|
||||||
} catch (FileNotFoundException | CalendarStorageException e) {
|
} catch (FileNotFoundException | CalendarStorageException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -245,6 +248,9 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
LocalAddressBook resource = LocalAddressBook.findByUid(ViewCollectionActivity.this, getContentResolver().acquireContentProviderClient(ContactsContract.Contacts.CONTENT_URI), account, info.uid);
|
LocalAddressBook resource = LocalAddressBook.findByUid(ViewCollectionActivity.this, getContentResolver().acquireContentProviderClient(ContactsContract.Contacts.CONTENT_URI), account, info.uid);
|
||||||
|
if (resource == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
count = resource.count();
|
count = resource.count();
|
||||||
} catch (ContactsStorageException e) {
|
} catch (ContactsStorageException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user