Skip to content

Commit

Permalink
fix: update selectors getSize logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zepfred committed Oct 10, 2024
1 parent 38016ff commit 2376f9b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public boolean isNeverEnding() {

@Override
public long getSize() {
return cachedEntityList.size();
return cachedEntityList != null ? cachedEntityList.size() : 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public boolean isCountable() {

@Override
public long getSize() {
return cachedEntityList.size();
return cachedEntityList != null ? cachedEntityList.size() : 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public boolean isNeverEnding() {

@Override
public long getSize() {
return cachedEntityMap.size();
return cachedEntityMap != null ? cachedEntityMap.size() : 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ public boolean isNeverEnding() {
@Override
public long getSize() {
long selectionSize = 0L;
for (SubChain anchorTrailingChain : anchorTrailingChainList) {
selectionSize += calculateSubChainSelectionSize(anchorTrailingChain);
if (anchorTrailingChainList != null) {
for (SubChain anchorTrailingChain : anchorTrailingChainList) {
selectionSize += calculateSubChainSelectionSize(anchorTrailingChain);
}
}
return selectionSize;
}
Expand Down

0 comments on commit 2376f9b

Please sign in to comment.