mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 05:57:00 -04:00
Fix null dereference when stylesheets are missing, added an error message
This commit is contained in:
@@ -35,6 +35,7 @@ StyleSheetP StyleSheet::byGameAndName(const Game& game, const String& name) {
|
|||||||
return package_manager.open<StyleSheet>(full_name);
|
return package_manager.open<StyleSheet>(full_name);
|
||||||
}
|
}
|
||||||
} catch (PackageNotFoundError& e) {
|
} catch (PackageNotFoundError& e) {
|
||||||
|
queue_message(MESSAGE_ERROR, _("Missing stylesheet: ") + full_name);
|
||||||
if (stylesheet_for_reading()) {
|
if (stylesheet_for_reading()) {
|
||||||
// we already have a stylesheet higher up, so just return a null pointer
|
// we already have a stylesheet higher up, so just return a null pointer
|
||||||
return StyleSheetP();
|
return StyleSheetP();
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ template <typename T>
|
|||||||
inline void after_reading(intrusive_ptr<T>& x, Version ver) {
|
inline void after_reading(intrusive_ptr<T>& x, Version ver) {
|
||||||
after_reading(*x, ver);
|
after_reading(*x, ver);
|
||||||
}
|
}
|
||||||
|
inline void after_reading(GameP&, Version) {}
|
||||||
|
inline void after_reading(StyleSheetP&, Version) {}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Container types
|
// ----------------------------------------------------------------------------- : Container types
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user