mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fix freeze when loading a set with missing templates
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user