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()