Permalink
Browse files

Detect invalid args in `po.hash()`.

For example, if a non-array is returned by `parse`.
  • Loading branch information...
1 parent 012d0e4 commit 661f2de0caa651fcdea748e5d16cee0ef4b15b3e @jasondavies jasondavies committed Dec 9, 2010
Showing with 41 additions and 39 deletions.
  1. +2 −1 polymaps.js
  2. +37 −37 polymaps.min.js
  3. +2 −1 src/Hash.js
View
@@ -1784,7 +1784,8 @@ po.hash = function() {
function hashchange() {
if (location.hash === s0) return; // ignore spurious hashchange events
var args = parse((s0 = location.hash).substring(1));
- if (args.length < 3 || args.some(isNaN)) move(); // replace bogus hash
+ if (!args || args.length == undefined || args.length < 3 || args.some(isNaN))
+ move(); // replace bogus hash
else {
var size = map.size();
map.zoomBy(args[0] - map.zoom(),
Oops, something went wrong.

0 comments on commit 661f2de

Please sign in to comment.