From bfe9f3f3868a5c70466f5a28eedbc0ed952d495d Mon Sep 17 00:00:00 2001 From: CPearl0 <1269596929@qq.com> Date: Wed, 31 Jan 2024 09:06:26 +0800 Subject: [PATCH] fix NullPointerException --- .../java/thedarkcolour/exdeorum/client/CompostColors.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java b/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java index a8b4db75..bf744806 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java +++ b/src/main/java/thedarkcolour/exdeorum/client/CompostColors.java @@ -152,7 +152,10 @@ public class CompostColors { if (!readMods.contains(modid)) { var id = entry.getKey().location().getPath(); - var jarFile = ModList.get().getModFileById(modid).getFile(); + var modFile = ModList.get().getModFileById(modid); + if (modFile == null) + continue; + var jarFile = modFile.getFile(); var modelPath = jarFile.findResource("assets/" + modid + "/models/item/" + id + ".json"); if (Files.exists(modelPath)) {