From d958a91ce936ff910e08ee568ff89ff65dab11a0 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 10 Mar 2026 08:55:33 +0200 Subject: [PATCH] fix crash when updating datapacks parent PR #5101 so for datapacks and datapacks only we need an extra check. Why? Because Datapacks are treated as ModLoaderType but they aren't a modloader. So the modLoaderTypesToList will generate an empty list even if loader is 64 (not 0). Signed-off-by: Trial97 --- launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp index 1539cc77e..dc23cd1f8 100644 --- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp +++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp @@ -151,7 +151,10 @@ void ModrinthCheckUpdate::checkVersionsResponse(QByteArray* response, std::optio // so we may want to filter it QString loader_filter; if (loader.has_value() && loader != 0) { - loader_filter = ModPlatform::getModLoaderAsString(ModPlatform::modLoaderTypesToList(*loader).first()); + auto modLoaders = ModPlatform::modLoaderTypesToList(*loader); + if (!modLoaders.isEmpty()) { + loader_filter = ModPlatform::getModLoaderAsString(modLoaders.first()); + } } // Currently, we rely on a couple heuristics to determine whether an update is actually available or not: