mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-03-30 19:20:09 +02:00
catch and ignore ConcurrentModificationException on some other places too
This commit is contained in:
parent
65a9600f75
commit
97518b98f5
@ -1292,8 +1292,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
minFetchedSearchTS -= FETCH_INTERVAL
|
minFetchedSearchTS -= FETCH_INTERVAL
|
||||||
eventsHelper.getEvents(minFetchedSearchTS, oldMinFetchedTS) { events ->
|
eventsHelper.getEvents(minFetchedSearchTS, oldMinFetchedTS) { events ->
|
||||||
events.forEach { event ->
|
events.forEach { event ->
|
||||||
if (searchResultEvents.firstOrNull { it.id == event.id && it.startTS == event.startTS } == null) {
|
try {
|
||||||
searchResultEvents.add(0, event)
|
if (searchResultEvents.firstOrNull { it.id == event.id && it.startTS == event.startTS } == null) {
|
||||||
|
searchResultEvents.add(0, event)
|
||||||
|
}
|
||||||
|
} catch (ignored: ConcurrentModificationException) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1306,8 +1309,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
maxFetchedSearchTS += FETCH_INTERVAL
|
maxFetchedSearchTS += FETCH_INTERVAL
|
||||||
eventsHelper.getEvents(oldMaxFetchedTS, maxFetchedSearchTS) { events ->
|
eventsHelper.getEvents(oldMaxFetchedTS, maxFetchedSearchTS) { events ->
|
||||||
events.forEach { event ->
|
events.forEach { event ->
|
||||||
if (searchResultEvents.firstOrNull { it.id == event.id && it.startTS == event.startTS } == null) {
|
try {
|
||||||
searchResultEvents.add(0, event)
|
if (searchResultEvents.firstOrNull { it.id == event.id && it.startTS == event.startTS } == null) {
|
||||||
|
searchResultEvents.add(0, event)
|
||||||
|
}
|
||||||
|
} catch (ignored: ConcurrentModificationException) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user