From 77981566a377ca014259172786cdbac700abd9ed Mon Sep 17 00:00:00 2001 From: Aicke Schulz Date: Mon, 29 Jul 2013 09:32:27 +0200 Subject: [PATCH] Check for url before url.match If we do not check if url is set, we may get an "Uncaught TypeError: Cannot call method 'match' of undefined". --- Source/History.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/History.js b/Source/History.js index b89c71c..9f7d957 100644 --- a/Source/History.js +++ b/Source/History.js @@ -21,7 +21,7 @@ provides: History var events = Element.NativeEvents, location = window.location, cleanURL = function(url){ - if (url.match(/^https?:\/\//)) url = '/' + url.split('/').slice(3).join('/'); + if (url && url.match(/^https?:\/\//)) url = '/' + url.split('/').slice(3).join('/'); return url; }, base = cleanURL(location.href),