Skip to content

Commit

Permalink
safety in case routeName is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
sometimeskind committed Jun 2, 2018
1 parent 842b290 commit 1aa6c74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/am-path-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function getPathHelpers(routesMap: { [routeName: RouteNameType]:
getAdditionalState(routeName: RouteNameType, resource: string): { params: ParamsType, query: ParamsType } {
const [path, search] = resource.split('?');
return {
params: evalPathParams(routeName, path) || {},
params: (routeName && evalPathParams(routeName, path)) || {},
query: qs.parse(search),
};
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "am-path-helpers",
"version": "0.0.1",
"version": "0.0.2",
"description": "Helpers for App Manager that provide enhanced tools for path matching",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 1aa6c74

Please sign in to comment.