From 9ed0569a6dee1fd58682768af314e0919fa92aed Mon Sep 17 00:00:00 2001 From: GenevensiS <66968533+G-e-n-e-v-e-n-s-i-S@users.noreply.github.com> Date: Sat, 8 Mar 2025 23:14:30 +0100 Subject: [PATCH] Fix freeze when loading a set with missing templates --- src/data/stylesheet.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/data/stylesheet.cpp b/src/data/stylesheet.cpp index 2514e172..2c0d4cd6 100644 --- a/src/data/stylesheet.cpp +++ b/src/data/stylesheet.cpp @@ -36,10 +36,14 @@ StyleSheetP StyleSheet::byGameAndName(const Game& game, const String& name) { } } catch (PackageNotFoundError& e) { queue_message(MESSAGE_ERROR, _("Missing stylesheet: ") + full_name); - if (stylesheet_for_reading()) { - // we already have a stylesheet higher up, so just return a null pointer - return StyleSheetP(); - } + + // This causes a freeze when the set contains two cards that use the same missing StyleSheet, and the second one has styling_data + // Also, it's probably better to ask the user for an alternative for each missing StyleSheet individually + //if (stylesheet_for_reading()) { + // // we already have a stylesheet higher up, so just return a null pointer + // return StyleSheetP(); + //} + // load an alternative stylesheet StyleSheetP ss = select_stylesheet(game, name); if (ss) {