Throw when trying to remove a child highlighter that does not exists
This commit is contained in:
parent
e444cd3937
commit
56237aa8f8
|
@ -39,6 +39,8 @@ void HighlighterGroup::add_child(HighlighterAndId&& hl)
|
|||
|
||||
void HighlighterGroup::remove_child(StringView id)
|
||||
{
|
||||
if (not m_highlighters.contains(id))
|
||||
throw runtime_error{format("no such child: {}", id)};
|
||||
m_highlighters.remove(id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user