JTAppleCalendar icon indicating copy to clipboard operation
JTAppleCalendar copied to clipboard

Fix #1217 - converted some properties from implicitly unwrapped optionals to address crash

Open jvisenti opened this issue 4 years ago • 4 comments

This PR changes JTACMonthLayout.delegate and JTACMonthDelegateProtocol._cachedConfiguration from implicitly unwrapped options to optionals. It addresses a crash reported in #1217 where the following line crashes in rare circumstances due to a force unwrapped optional with a nil value.

JTACMonthLayout.Swift:168:

strictBoundaryRulesShouldApply = thereAreHeaders || delegate._cachedConfiguration.hasStrictBoundaries

Although I don't know under which circumstances the implicitly unwrapped optional(s) are nil, this PR should at least prevent the crash. It should have no impact on functionality.

jvisenti avatar May 17 '21 09:05 jvisenti

@patchthecode Is there any plans to merge this PR ? I'm facing the exact same crash in my code.

mohanvydehi avatar Sep 25 '23 08:09 mohanvydehi

I'll review this on the weekend. in the mean time @mohanvydehi does this fix your issue?

patchthecode avatar Sep 26 '23 04:09 patchthecode

Yes, it worked for me @patchthecode

mohanreddys-wal avatar Sep 26 '23 04:09 mohanreddys-wal

Our team has the same issue. It would be great to see this PR merged.

robertcrabtree avatar Jan 24 '24 18:01 robertcrabtree