fixed: errors in templates could cause program to hang/crash

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@796 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-12-29 21:12:11 +00:00
parent eed8ba4274
commit e49f2eebcb
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -108,6 +108,9 @@ void StylePanel::selectCard(const CardP& card) {
void StylePanel::onStyleSelect(wxCommandEvent&) {
if (list->hasSelection() && card) {
StyleSheetP stylesheet = list->getSelection<StyleSheet>();
if (stylesheet->game != set->game) {
throw PackageError(_("Stylesheet made for the wrong game"));
}
if (stylesheet == set->stylesheet) {
// select no special style when selecting the same style as the set default
stylesheet = StyleSheetP();