mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 13:09:00 +00:00
(assistant) Add bounds checks for domain idx
This commit is contained in:
parent
3566fe296a
commit
ca27d95ce1
@ -195,9 +195,14 @@ public class SimilarDomainsService {
|
||||
public List<RpcSimilarDomain> getSimilarDomains(int domainId, int count) {
|
||||
int domainIdx = domainIdToIdx.get(domainId);
|
||||
|
||||
if (domainNeighbors.length >= domainIdx) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
TIntList allIdsList = domainNeighbors[domainIdx];
|
||||
if (allIdsList == null)
|
||||
return List.of();
|
||||
|
||||
TIntList allIds = new TIntArrayList(new TIntHashSet(allIdsList));
|
||||
|
||||
TIntSet linkingIdsDtoS = getLinkingIdsDToS(domainIdx);
|
||||
|
Loading…
Reference in New Issue
Block a user