Don't continue to match when no h2 was found

When the page has no `<h2>` at all, there's an error showing up in the JS console. This patch fixes that.