Skip to content

Commit 8ede896

Browse files
committed
Fix sign container NPE
1 parent 32f15f7 commit 8ede896

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bukkit/src/main/java/io/github/rothes/protocolstringreplacer/replacer/containers/SignNbtContainer.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.github.rothes.protocolstringreplacer.replacer.containers;
22

3+
import de.tr7zw.changeme.nbtapi.NBTCompound;
34
import de.tr7zw.changeme.nbtapi.NBTContainer;
45
import de.tr7zw.changeme.nbtapi.NBTList;
56
import io.github.rothes.protocolstringreplacer.ProtocolStringReplacer;
@@ -34,8 +35,12 @@ public void entriesPeriod() {
3435
children.clear();
3536
jsonReplaceables.clear();
3637
if (POST_20) {
37-
addLines(content.getCompound("front_text").getStringList("messages"));
38-
addLines(content.getCompound("back_text").getStringList("messages"));
38+
NBTCompound compound = content.getCompound("front_text");
39+
if (compound != null)
40+
addLines(compound.getStringList("messages"));
41+
compound = content.getCompound("back_text");
42+
if (compound != null)
43+
addLines(compound.getStringList("messages"));
3944
} else {
4045
String key;
4146
for (int i = 1; i <= 4; i++) {

0 commit comments

Comments
 (0)