From c12cd62ce7a7478458319b0394e53b70a678a7a0 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 26 Mar 2015 03:48:30 -0400 Subject: [PATCH] fix(listeners) pop: event.state could be null --- lib/client/listeners.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/client/listeners.js b/lib/client/listeners.js index fb0fe1e5..3a374897 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -317,17 +317,17 @@ var Util, DOM, CloudFunc, CloudCmd; function pop() { Events.add('popstate', function(event) { - var path = event.state; + var path = event.state || ''; path = path.replace(CloudFunc.FS, ''); - if (path) + if (!path) + CloudCmd.route(location.hash); + else CloudCmd.loadDir({ path : path, history : false }); - else - CloudCmd.route(location.hash); }); }