Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

Commit

Permalink
Added error for platform which does not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
rasvaan committed Jan 17, 2017
1 parent e332b66 commit 60ec3b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helpers/platforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ module.exports = {
return parsed;
},
platform: function(id) {
return this.platforms().find(function(platform) {
const platform = this.platforms().find(platform => {
return platform.id === id;
});

if (!platform) throw new Error(`${id} does not exist`);

return platform;
},
platformIds: function() {
return this.platforms().map(platform => platform.id);
Expand Down

0 comments on commit 60ec3b5

Please sign in to comment.