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 null exception #44

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions VirtualListView/PositionalViewSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public int TotalCount

int GetTotalCount()
{
if (Adapter is null)
Copy link
Owner

Choose a reason for hiding this comment

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

This seems innocent enough, however it should be moved above the line of code it's under... really to the start of the method. You're checking for Adapter being null after the call to Adapter.GetNumberOfSections()...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah sounds right :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed it

{
return 0;
}

var sum = 0;

var hasAtLeastOneItem = false;
Expand Down
Loading