From aaeff9a25ef6a916067dd10d21ee2df2eeb8f16e Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 15 Feb 2024 12:27:18 +0000 Subject: [PATCH] Fix possible NPE in MappingIoConverter --- build.gradle | 2 +- .../enigma/translation/mapping/serde/MappingIoConverter.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8c2461bf..81412dfc 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ subprojects { } group = 'cuchaz' - version = '2.4.0' + version = '2.4.1' version = version + (System.getenv("GITHUB_ACTIONS") ? "" : "+local") diff --git a/enigma/src/main/java/cuchaz/enigma/translation/mapping/serde/MappingIoConverter.java b/enigma/src/main/java/cuchaz/enigma/translation/mapping/serde/MappingIoConverter.java index 3843d8e4..b7696d2d 100644 --- a/enigma/src/main/java/cuchaz/enigma/translation/mapping/serde/MappingIoConverter.java +++ b/enigma/src/main/java/cuchaz/enigma/translation/mapping/serde/MappingIoConverter.java @@ -71,7 +71,10 @@ private static void writeClass(EntryTreeNode classNode, EntryMap parts = new LinkedList<>(); newMappingTree.visitClass(classEntry.getFullName()); - newMappingTree.visitComment(MappedElementKind.CLASS, mapping.javadoc()); + + if (mapping != null) { + newMappingTree.visitComment(MappedElementKind.CLASS, mapping.javadoc()); + } do { mapping = oldMappingTree.get(classEntry);