From 11821590643e96753aceb7cf74a76624bc0d717a Mon Sep 17 00:00:00 2001 From: Fulminazzo Date: Thu, 11 Apr 2024 19:54:54 +0200 Subject: [PATCH] Fixed null pointer exception --- gui/base/src/main/java/it/angrybear/yagl/guis/GUIImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gui/base/src/main/java/it/angrybear/yagl/guis/GUIImpl.java b/gui/base/src/main/java/it/angrybear/yagl/guis/GUIImpl.java index 7fba177e..4ce49ae4 100644 --- a/gui/base/src/main/java/it/angrybear/yagl/guis/GUIImpl.java +++ b/gui/base/src/main/java/it/angrybear/yagl/guis/GUIImpl.java @@ -102,7 +102,9 @@ public boolean isMovable(int slot) { @Override public @NotNull List getContents() { List list = new LinkedList<>(); - for (Contents content : this.contents) list.addAll(Arrays.asList(content.contents)); + for (Contents content : this.contents) + if (content != null) + list.addAll(Arrays.asList(content.contents)); return list; }