mirror of
https://github.com/aluxnimm/outlookcaldavsynchronizer.git
synced 2026-04-25 11:05:56 +03:00
[GH-ISSUE #456] System.DevideByZeroException: Attempted to devide by zero #439
Labels
No labels
1.0
1.0
1.0
2.0
Feature
Feature request
Google
Google Calendar
async
attachement
auto-migrated
auto-migrated
auto-migrated
bug
critical
enhancement
help wanted
implemented
pull-request
solved
solved
sourceforge
sourceforge
sourceforge
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/outlookcaldavsynchronizer#439
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Zenith-Mx on GitHub (Sep 16, 2025).
Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/456
When trying to synchronize Outlook events to Nextcloud via CalDavSynchronizer, one event caused this error which always pops up after every synchronization attempt.
The issue occurs within the AddMasterEvent(IICalendar calendar) method in the CalDavSynchronizer.Implementation.Events.EventEntityManager class. I would suggest that it's the following part of the code which causes this error, since it's the only division I was able to find directly within the AddMasterEvent method:
var intervalInDays = GreatestCommonDivisor(sortedExceptionsWithDistance.Select(d => d.DistanceFromMasterInDays));
var numberOfEceptions = sortedExceptionsWithDistance.Last().DistanceFromMasterInDays / intervalInDays + 1;
It seems like it's possible that intervalInDays + 1 is equal to zero, causing a System.DevideByZeroException.
Implementing handling for this problem would be greatly appreciated, as the only way I found to fix the error popup during synchronization is to fully remove the event.