Skip to content

Commit

Permalink
fix NPE(2), but empty huIds shall be considered as not high volume
Browse files Browse the repository at this point in the history
#579
(cherry picked from commit 7f555c8)
  • Loading branch information
teosarca authored and metas-ts committed Sep 8, 2017
1 parent f43436c commit a7a4601
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,21 @@ public static boolean isHighVolume(final List<DocumentFilter> stickyFilters)
}

final Set<Integer> huIds = huIdsFilterData.getInitialHUIds();
return huIds == null || huIds.isEmpty() || huIds.size() >= HUEditorViewBuffer_HighVolume.HIGHVOLUME_THRESHOLD;
if(huIds == null)
{
// null means no restrictions, so we might have a lot of HUs
return true; // high volume
}
else if (huIds.isEmpty())
{
// no HUs will be allowed
return false; // not high volume
}
else
{
// consider high volume if it's above give threshold
return huIds.size() >= HUEditorViewBuffer_HighVolume.HIGHVOLUME_THRESHOLD;
}
}

public static final class HUIdsSqlDocumentFilterConverter implements SqlDocumentFilterConverter
Expand Down

0 comments on commit a7a4601

Please sign in to comment.