We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15b46f7 commit bf4eaa8Copy full SHA for bf4eaa8
1 file changed
src/main/java/gregtech/api/capability/impl/ItemHandlerList.java
@@ -137,10 +137,11 @@ public int size() {
137
138
@Override
139
public boolean add(IItemHandler handler) {
140
+ if (this == handler) {
141
+ throw new IllegalArgumentException("Cannot add a handler list to itself!");
142
+ }
143
int s = size();
144
if (handler instanceof ItemHandlerList list) {
- // possible infinite recursion
- // throw instead?
145
addAll(s, list);
146
} else {
147
add(s, handler);
0 commit comments