From 1c5184e31680a74311f53c4cd6f8b78ec46a005b Mon Sep 17 00:00:00 2001 From: Sally Knight Date: Fri, 13 Mar 2026 21:43:26 +0300 Subject: [PATCH] fix: add more null checks to options --- Minecraft.Client/GameState/Options.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/GameState/Options.cpp b/Minecraft.Client/GameState/Options.cpp index 47acf2f26..02d8727f4 100644 --- a/Minecraft.Client/GameState/Options.cpp +++ b/Minecraft.Client/GameState/Options.cpp @@ -279,12 +279,14 @@ void Options::toggle(const Options::Option *option, int dir) if (option == Option::GRAPHICS) { fancyGraphics = !fancyGraphics; - minecraft->levelRenderer->allChanged(); + // 4jcraft: ensure level exists before applying + if(minecraft->level) minecraft->levelRenderer->allChanged(); } if (option == Option::AMBIENT_OCCLUSION) { ambientOcclusion = !ambientOcclusion; - minecraft->levelRenderer->allChanged(); + // 4jcraft: ensure level exists before applying + if(minecraft->level) minecraft->levelRenderer->allChanged(); } // 4J-PB - don't do the file save on the xbox