3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-26 00:00:55 +01:00

Add another validation case although it's not strictly required

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-11-24 12:05:27 -05:00
Ursprung 084b741375
Commit aa7aee9dd7

Datei anzeigen

@ -220,13 +220,13 @@ public class AvailableCommands implements MinecraftPacket {
// Ensure all children exist. Note that we delay checking if the node has been built yet; // Ensure all children exist. Note that we delay checking if the node has been built yet;
// that needs to come after this node is built. // that needs to come after this node is built.
for (int child : children) { for (int child : children) {
if (child >= wireNodes.length) { if (child < 0 || child >= wireNodes.length) {
throw new IllegalStateException("Node points to non-existent index " + redirectTo); throw new IllegalStateException("Node points to non-existent index " + redirectTo);
} }
} }
if (redirectTo != -1) { if (redirectTo != -1) {
if (redirectTo >= wireNodes.length) { if (redirectTo < 0 || redirectTo >= wireNodes.length) {
throw new IllegalStateException("Node points to non-existent index " + redirectTo); throw new IllegalStateException("Node points to non-existent index " + redirectTo);
} }
} }