mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +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) {
|
public List<RpcSimilarDomain> getSimilarDomains(int domainId, int count) {
|
||||||
int domainIdx = domainIdToIdx.get(domainId);
|
int domainIdx = domainIdToIdx.get(domainId);
|
||||||
|
|
||||||
|
if (domainNeighbors.length >= domainIdx) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
|
||||||
TIntList allIdsList = domainNeighbors[domainIdx];
|
TIntList allIdsList = domainNeighbors[domainIdx];
|
||||||
if (allIdsList == null)
|
if (allIdsList == null)
|
||||||
return List.of();
|
return List.of();
|
||||||
|
|
||||||
TIntList allIds = new TIntArrayList(new TIntHashSet(allIdsList));
|
TIntList allIds = new TIntArrayList(new TIntHashSet(allIdsList));
|
||||||
|
|
||||||
TIntSet linkingIdsDtoS = getLinkingIdsDToS(domainIdx);
|
TIntSet linkingIdsDtoS = getLinkingIdsDToS(domainIdx);
|
||||||
|
Loading…
Reference in New Issue
Block a user