Skip to content

Commit

Permalink
Fix putting null check earlier
Browse files Browse the repository at this point in the history
Codelisk committed May 31, 2024
1 parent 90af7a5 commit 12b0880
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions VirtualListView/PositionalViewSelector.cs
Original file line number Diff line number Diff line change
@@ -26,14 +26,15 @@ public int TotalCount

int GetTotalCount()
{
var sum = 0;

var hasAtLeastOneItem = false;
var numberOfSections = Adapter.GetNumberOfSections();
if (Adapter is null)
{
return 0;
}

var sum = 0;

var hasAtLeastOneItem = false;
var numberOfSections = Adapter.GetNumberOfSections();

if (HasGlobalHeader && numberOfSections > 0)
{

0 comments on commit 12b0880

Please sign in to comment.