Skip to content

Commit 6e12858

Browse files
authored
Only print warning when there actually are exceptions (#152)
1 parent ad0c68d commit 6e12858

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidRecurringCalendar.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ class AndroidRecurringCalendar(
222222
if (syncId == null || !recurring) {
223223
// 1. main event doesn't have sync id → exceptions wouldn't be associated to main event by calendar provider, so ignore them
224224
// 2. main event not recurring → exceptions are useless, ignore them
225-
logger.log(Level.WARNING, "Dropping exceptions of event because event is not recurring or _SYNC_ID is not set", main)
225+
226+
if (original.exceptions.isNotEmpty())
227+
logger.log(Level.WARNING, "Dropping exceptions of event because event is not recurring or _SYNC_ID is not set", main)
228+
226229
return EventAndExceptions(main = main, exceptions = emptyList())
227230
}
228231

0 commit comments

Comments
 (0)