diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index 36e08375e..03b85b369 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -120,11 +120,11 @@ template static T get_value(AssDialogue const& line, int blockn, T initial, wxString tag, wxString alt = "") { for (int i = blockn; i >= 0; i--) { AssDialogueBlockOverride *ovr = dynamic_cast(line.Blocks[i]); - if (ovr) { - for (int j = (int)ovr->Tags.size() - 1; j >= 0; j--) { - if (ovr->Tags[j]->Name == tag || ovr->Tags[j]->Name == alt) { - return ovr->Tags[j]->Params[0]->Get(); - } + if (!ovr) continue; + + for (int j = (int)ovr->Tags.size() - 1; j >= 0; j--) { + if (ovr->Tags[j]->Name == tag || ovr->Tags[j]->Name == alt) { + return ovr->Tags[j]->Params[0]->Get(initial); } } } @@ -735,6 +735,7 @@ void SubsEditBox::SetTag(wxString tag, wxString value, bool atEnd) { } else { ovr->Tags[i]->Params[0]->Set(value); + ovr->Tags[i]->Params[0]->omitted = false; found = true; } }