From 6c0b6f831fe4de450b4e89a942177829733e10b5 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 6 May 2019 17:22:59 +0100 Subject: Assert instead of checking At this point, we MUST have an element created, so assert it rather than half-heartedly checking. Signed-off-by: Daniel Silverstone --- bindings/hubbub/parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c index 6ee3004..1c0e03f 100644 --- a/bindings/hubbub/parser.c +++ b/bindings/hubbub/parser.c @@ -219,7 +219,10 @@ static hubbub_error create_element(void *parser, const hubbub_tag *tag, } } - if (element != NULL && tag->n_attributes > 0) { + /* By now, we MUST have constructed an element */ + assert(element != NULL); + + if (tag->n_attributes > 0) { herr = add_attributes(parser, element, tag->attributes, tag->n_attributes); if (herr != HUBBUB_OK) -- cgit v1.2.3