From 84fcb8046d1ebc5bc0e4479db7c817bb34da11b6 Mon Sep 17 00:00:00 2001 From: rlnt Date: Tue, 22 Oct 2024 13:19:25 +0200 Subject: [PATCH] prevent crashing when runtime isn't loaded fixes #101 --- CHANGELOG.md | 3 ++- .../java/com/almostreliable/unified/AlmostUnifiedCommon.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8666136..9ce5394 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning]. ## Unreleased -- / + +- fixed crash when runtime isn't loaded ([#101](https://github.com/AlmostReliable/almostunified/issues/101)) ## [1.2.0] - 2024-10-06 diff --git a/Common/src/main/java/com/almostreliable/unified/AlmostUnifiedCommon.java b/Common/src/main/java/com/almostreliable/unified/AlmostUnifiedCommon.java index d944220..78a5c98 100644 --- a/Common/src/main/java/com/almostreliable/unified/AlmostUnifiedCommon.java +++ b/Common/src/main/java/com/almostreliable/unified/AlmostUnifiedCommon.java @@ -46,12 +46,12 @@ public final class AlmostUnifiedCommon { } public static void onRecipeManagerError(ResourceLocation recipe) { - assert RUNTIME != null; + if (RUNTIME == null) return; RUNTIME.getDebugHandler().collectRecipeError(recipe); } public static void onRecipeManagerEnd() { - assert RUNTIME != null; + if (RUNTIME == null) return; RUNTIME.getDebugHandler().finish(); } }