ensure id list not empty

This commit is contained in:
Damien Elmes 2020-03-16 13:16:43 +10:00
parent 08d205d377
commit e790367b1e

View file

@ -247,7 +247,7 @@ fn search_node_for_text_with_argument<'a>(
/// ensure a list of ids contains only numbers and commas, returning unchanged if true
/// used by nid: and cid:
fn check_id_list(s: Cow<str>) -> ParseResult<Cow<str>> {
if s.as_bytes().iter().any(|&c| !is_digit(c) && c != b',') {
if s.is_empty() || s.as_bytes().iter().any(|&c| !is_digit(c) && c != b',') {
Err(ParseError {})
} else {
Ok(s)