aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java/me/shedaniel/rei/impl/common
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/impl/common')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java
index 293f3bc3e..af9f4ddb3 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/type/EntryRegistryImpl.java
@@ -204,7 +204,11 @@ public class EntryRegistryImpl implements EntryRegistry {
if (afterEntry != null) {
int index = registryList.lastIndexOf(afterEntry);
- registryList.addAll(index, filtered, hashes);
+ if (index != -1) {
+ registryList.addAll(index, filtered, hashes);
+ } else {
+ registryList.addAll(filtered, hashes);
+ }
} else registryList.addAll(filtered, hashes);
for (EntryRegistryListener listener : listeners) {