Commit d5893fad authored by twanvl's avatar twanvl

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

parent fff8a5f7
......@@ -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);
......
......@@ -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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment