Permalink
Browse files

Guarding against empty root.

  • Loading branch information...
1 parent 4d1fe7e commit 7b9548fe3aacefa79f28ddc78aed2ca13482389e Dan Gilbert committed Sep 24, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 backbone_named_routes.js
View
@@ -38,8 +38,7 @@
var prependRoot = function(route) {
var history = Backbone.history;
- if (!history) return route;
- if (!history.options) return route;
+ if (!history || !history.options || history.options.root == "/") return route;
routeWithRoot = history.options.root + '/' + route;
return routeWithRoot.replace("//", "/");

0 comments on commit 7b9548f

Please sign in to comment.