don't crash when an action=nullptr (partial fix for #20)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1455 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-07-21 19:24:51 +00:00
parent c5d92f7d13
commit 4c3acef3fa
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ TextValueAction* toggle_format_action(const TextValueP& value, const String& tag
new_value += _("</") + tag + _(">");
new_value += str.substr(end_i);
} else {
// we are inside this tag, _('remove') it
// we are inside this tag, 'remove' it
new_value = str.substr(0, start_i);
new_value += _("</") + tag + _(">");
new_value += str.substr(start_i, end_i - start_i);
+4 -2
View File
@@ -13,6 +13,8 @@
// ----------------------------------------------------------------------------- : ValueEditor
void ValueEditor::addAction(ValueAction* a) {
a->isOnCard(editor().getCard().get());
editor().addAction(a);
if (a) {
a->isOnCard(editor().getCard().get());
editor().addAction(a);
}
}