Fix crash on unexpected closing tag after error

This commit is contained in:
Max Brunsfeld 2018-06-15 15:35:50 -07:00
parent 9cccc08b84
commit 43f84098b8
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ struct Scanner {
if (is_closing_tag) {
// The tag correctly closes the topmost element on the stack
if (next_tag == tags.back()) return false;
if (!tags.empty() && tags.back() == next_tag) return false;
// Otherwise, dig deeper and queue implicit end tags (to be nice in
// the case of malformed HTML)