Skip to content

Commit

Permalink
Handle null uri.pathname bug
Browse files Browse the repository at this point in the history
Sometimes modules do not require a full path,
and can use shorter version, e.g.   overzoom://?source=blah
which results in the null pathname, which fails in the unescape.
  • Loading branch information
Yuri Astrakhan committed Jan 21, 2016
1 parent 763f27c commit 676b098
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tilelive.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ tilelive.load = function(uri, callback) {

if (typeof uri === 'string') {
uri = url.parse(uri, true);
uri.pathname = qs.unescape(uri.pathname);
if (uri.pathname) {
uri.pathname = qs.unescape(uri.pathname);
}
}

// Handle uris in the format /path/to/dir?id=bar
Expand Down

0 comments on commit 676b098

Please sign in to comment.