-
Notifications
You must be signed in to change notification settings - Fork 70
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 crashes when moving objects between sections #97
base: master
Are you sure you want to change the base?
Conversation
f468705
to
e8e4022
Compare
@ngs the ObjC example project has a number of tests in it. Can you create a test that demonstrates the failure and shows this fixing it? |
NSInteger insertIndex = objectChange.updatedIndexpath.row; | ||
if (insertIndex >= section.objects.count) { | ||
insertIndex = section.objects.count - 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems problematic since the logic should not allow this to begin with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, then is the problem in the logic that shouldn't be allowing this to begin with? Obviously it's happening to some people, so what might be causing it in the first place.
I do agree that it's better to fix the cause of the problem rather than trying to handle when it happens here though.
I've been experiencing a crash recently on the line with the error message "Attemting to insert at index beyond bounds", and this pull request fixes it. My situation is fairly niche: The crash happens in a specific situation though - it's when I log the user log, deleting all of their messages, and then log them back in. Upon logging them back in, it shows a cell for that conversation, which creates the conversation controller, which calls performFetch and crashes. I don't entirely understand why this crash happens, but I implemented this pull request, and it fixes it. To make sure, I added a breakpoint inside the if statement, and sure enough, when it would have crashed, instead it continued fine. Right now I'm implementing it as a manual change in my code, but I'd urge you to accept this pull request as it fixes my problem. |
Hi,
As I reported in #96 , there was a bug with moving objects between sections.
This pull request fixes #96