Skip to content

Commit

Permalink
Merge pull request #2540 from apinf/hotfix/fix-apiName-helper-and-das…
Browse files Browse the repository at this point in the history
…hboard-subscriptions

Ensure API document is available before returning name
  • Loading branch information
marla-singer committed May 17, 2017
2 parents 19f2d59 + c4c77b9 commit c3cb04a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion about/client/about.html
Expand Up @@ -33,7 +33,7 @@ <h3>
Apinf
</dt>
<dd>
0.44.0
0.44.1
</dd>
<dt>
API Umbrella
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "apinf",
"version": "0.44.0",
"version": "0.44.1",
"description": "API management portal and proxy.",
"main": "index.js",
"directories": {
Expand Down
8 changes: 6 additions & 2 deletions proxy_backends/collection/helpers.js
Expand Up @@ -13,7 +13,11 @@ ProxyBackends.helpers({
const apiId = this.apiId;
// Get API
const api = Apis.findOne(apiId);
// Return API Name
return api.name;

// Make sure API was found before accessing name property
if (api) {
// Return API Name
return api.name;
}
},
});

0 comments on commit c3cb04a

Please sign in to comment.