From fa72f25fd5bb8bef5dfdc2a9f966264dc3adf1dc Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 14 Oct 2014 07:29:59 +0200 Subject: [PATCH] Fix issue when `` doesn't have any attribs Close #6 --- src/pjax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pjax.js b/src/pjax.js index 2f6464e..61d2a51 100644 --- a/src/pjax.js +++ b/src/pjax.js @@ -348,7 +348,7 @@ , htmlRegex = /]+>/gi , htmlAttribsRegex = /\s?[a-z:]+(?:\=(?:\'|\")[^\'\">]+(?:\'|\"))*/gi , matches = html.match(htmlRegex) - if (matches.length) { + if (matches && matches.length) { matches = matches[0].match(htmlAttribsRegex) if (matches.length) { matches.shift()