Skip to content

Commit

Permalink
[bugfux] Avoid IndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Sep 2, 2024
1 parent 6816504 commit 079ce89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions exist-core/src/main/java/org/exist/xquery/value/Type.java
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,11 @@ public static int getSuperType(final int subtype) {
return subtype;
}

if (subtype >= superTypes.length) {
// Note that EMPTY_SEQUENCE is *not* a sub-type of anything else than itself
throw new IllegalArgumentException("Type: " + subtype + " has no super types defined");
}

final int supertype = superTypes[subtype];
if (supertype == 0) {
LOG.warn("eXist-db does not define a super-type for the sub-type {}", getTypeName(subtype), new Throwable());
Expand Down

0 comments on commit 079ce89

Please sign in to comment.