Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application got crashed at JTACMonthLayout due to nil value #1378

Open
NIRANJANPRASAD opened this issue Jul 17, 2023 · 11 comments
Open

Application got crashed at JTACMonthLayout due to nil value #1378

NIRANJANPRASAD opened this issue Jul 17, 2023 · 11 comments

Comments

@NIRANJANPRASAD
Copy link

(Required) Version Number:
8.0.3

Description

trictBoundaryRulesShouldApply = thereAreHeaders || delegate._cachedConfiguration.hasStrictBoundaries
line 168
Thread 1: Swift runtime failure: Unexpectedly found nil while implicitly unwrapping an Optional value

Steps To Reproduce

Expected Behavior

Additional Context

@patchthecode
Copy link
Owner

can you produce a sample app with the issue please?

@Swathiga-proj
Copy link

Screenshot 2023-08-08 at 12 21 35 PM

I tried using pods and package dependancies, still getting crash here

@patchthecode
Copy link
Owner

can you produce a sample app with the issue please?

@timfraedrich
Copy link

I am having a similar Issue with a crash in JTACMonthLayout.swift+168. The problem is only present on iOS 17 and the app always crashes in the first few seconds of execution suggesting an issue while loading the view, where the cachedConfiguration has not been set, but the view is already being laid out.

So far I have not been able to reproduce the crash nor produce a sample app with the issue, but it affects roughly 25% of my app's users on iOS 17, so this is not just a rare edge case.

Maybe this additional context as to when the crash occurs can help you diagnose the issue. I will continue to look for ways to fix this and keep you posted on any progress.

@patchthecode
Copy link
Owner

patchthecode commented Sep 21, 2023

Ok, it help a bit, but do you have any crash logs at all? Or is it crashing in the same location as the image above?
Also can you confirm what version you are using?

8.0.5 has a fix for that very crash

@timfraedrich
Copy link

We have been using 8.0.5 for a while now, the issue only came up with iOS 17. You can find a crash log here. Yes, as mentioned above it crashes in JTACMonthLayout.swift on Line 168.

@patchthecode
Copy link
Owner

im just updating to the latest xcode today.
give some time to investigate

@patchthecode
Copy link
Owner

@timfraedrich possible.
In your app, is it possible that your start date is greater than your end date?

@Swathiga-proj
you were able to see the crash in development mode, can you please provide a sample app? I just updated to latest iOS my mine is running fine

@NIRANJANPRASAD
if you are able to provide a smple app this will help

@patchthecode
Copy link
Owner

patchthecode commented Sep 23, 2023

@timfraedrich

i still need some sort of sample code.
I need to know how you are setting up the delegate, setting up the configs etc.
I cant tell anything more seeing some code/sample app.

These things are important:

  1. are you setting things up in code?
  2. are you using storyboard?
  3. is it a mixture of both? and if so, how is the delegate setup?

etc etc

If you make a bare minimum sample app that closely resembles your real app i can know. forget about designing it, just a base app will do. If you are unable to do this, then we'll have to spend time here with many questions (since i am unable to reproduce it)

Since its happening for some of your users (on ios 17) and not all on ios 17, then I am interested to see what setup you have.

@patchthecode
Copy link
Owner

patchthecode commented Sep 30, 2023

@timfraedrich
Ok i had some time to debug your issue.

You are experiencing this crash because you data source is not set by the time by the time the following code is run:

strictBoundaryRulesShouldApply = thereAreHeaders || delegate._cachedConfiguration.hasStrictBoundaries

Your data source should have been set before that code is hit.
Can you tell me how/where you are setting your dataSource?

But regardless, you code should not crash, therefore I have updated the code base to make the code safer.

fix done here 6b1f96b

@patchthecode
Copy link
Owner

Also, adding to the confusion,

The errors mentioned here on this issue are 2 separate errors.
@Swathiga-proj you issue is due to you not correctly setting up the delegates and data source.
while
@timfraedrich Your issue should be resolved in the latest fix to master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants