Fix freeze when loading a set with missing templates

This commit is contained in:
GenevensiS
2025-03-08 23:16:34 +01:00
committed by GitHub
+8 -4
View File
@@ -36,10 +36,14 @@ StyleSheetP StyleSheet::byGameAndName(const Game& game, const String& name) {
} }
} catch (PackageNotFoundError& e) { } catch (PackageNotFoundError& e) {
queue_message(MESSAGE_ERROR, _("Missing stylesheet: ") + full_name); 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 // This causes a freeze when the set contains two cards that use the same missing StyleSheet, and the second one has styling_data
return StyleSheetP(); // 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 // load an alternative stylesheet
StyleSheetP ss = select_stylesheet(game, name); StyleSheetP ss = select_stylesheet(game, name);
if (ss) { if (ss) {