Permalink
Browse files

fixed null pointer when matching routes

  • Loading branch information...
1 parent cc6eb45 commit 739f862477f3fac3224e1f8d6e9131a8c7738e7b @mafintosh committed Dec 20, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 index.js
  2. +1 −1 package.json
View
@@ -179,7 +179,7 @@ var decodeURL = function(url) {
Root.prototype.matches = function(request) {
var url = decodeURL(request.url);
- return this.routes[request.method].some(function(entry) {
+ return (this.routes[request.method] || []).some(function(entry) {
return entry.pattern(url);
});
};
View
@@ -1,6 +1,6 @@
{
"name":"root",
- "version":"0.5.11",
+ "version":"0.5.12",
"dependencies": {"murl":"0.2.x", "protein":"0.5.x", "network-address":"0.0.x"},
"repository": "git://github.com/mafintosh/root",
"description":"a super lightweight web framework featuring prototype mixin support and routing",

0 comments on commit 739f862

Please sign in to comment.