Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Added null check in IsLastItemInContainerConverter. #506

Merged
merged 3 commits into from Aug 18, 2016

Conversation

grokys
Copy link
Contributor

@grokys grokys commented Aug 17, 2016

#503 is a crash that seems to occur here. Can't reproduce locally but there's only so much that can cause an NRE in this method so try to avoid it in future.

#503 is a crash that seems to occur here. Can't reproduce locally but
there's only so much that can cause an NRE in this method so try to
avoid it in future.
{
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation seems heavily screwed up here.

Also, this is probably enough:

return ic != null ? ic.ItemContainerGenerator.IndexFromContainer(item) == ic.Items.Count - 1 : false;

If ic is not null than Items won't be null either (I peeked, it's created in the getter).

{
return false;
}
return ic?.ItemContainerGenerator.IndexFromContainer(item) == ic.Items.Count - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it still crash on the right-hand side in ic.Items.Count?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh!

@shana shana merged commit b752ef1 into master Aug 18, 2016
@shana shana deleted the issues/503-crash-in-create-repository branch August 18, 2016 13:17
@shana
Copy link
Contributor

shana commented Aug 18, 2016

🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants