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

Fix Fatal error: Division by zero in remainder operation #17

Closed

Conversation

MussaCharles
Copy link

@MussaCharles MussaCharles commented Feb 21, 2021

This fixes Thread 1: Fatal error: Division by zero in remainder operation when for some reasons prepare() method is called with zero contentWidth.

I was working on my custom fork where the collectionView should automatically calculate its size based on the Intrinsic content size. Then After awhile I was greeted by the mentioned error. Refer to the screenshot below.

Screen Shot 2021-02-21 at 1 43 50 PM

I fixed the issue by preventing further calculations unless the columnsCount is greater than zero.
So I thought it will be a great addition if it doesn't break any of your calculations. (So far it doesn't break anything based on my use case).

@VadzimMarozau
Copy link
Member

There are few other places where division by zero is possible. All these places will be checked and fixed at one of the next versions of the app.

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

Successfully merging this pull request may close these issues.

None yet

2 participants