fix: empty hosts array in filterHostsByLeadThreshold (#19343)
* return early if hosts is empty * feedback Co-authored-by: Alex van Andel <me@alexvanandel.com> --------- Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
co-authored by
Alex van Andel
CarinaWolli
parent
6847781a7f
commit
9a271f397b
@@ -103,7 +103,7 @@ export const filterHostsByLeadThreshold = async <T extends BaseHost<BaseUser>>({
|
||||
if (maxLeadThreshold === 0) {
|
||||
throw new Error(errorCodes.MAX_LEAD_THRESHOLD_FALSY);
|
||||
}
|
||||
if (maxLeadThreshold === null) {
|
||||
if (maxLeadThreshold === null || hosts.length < 1) {
|
||||
return hosts; // don't apply filter.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user