Fix NPE when removing elements before first draw

This commit is contained in:
johni0702
2015-10-11 10:36:14 +02:00
parent 2b0ada5f65
commit 4e901465fa

View File

@@ -112,7 +112,7 @@ public abstract class AbstractGuiContainer<T extends AbstractGuiContainer<T>>
@Override
public T removeElement(GuiElement element) {
if (elements.remove(element) != null) {
if (elements.remove(element) != null && layedOutElements != null) {
layedOutElements.remove(element);
}
return getThis();