Skip to content

Commit

Permalink
Throw an error if trying to register non-tech
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Nov 9, 2015
1 parent 7c400bd commit 25f7d80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/tech/tech.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ class Tech extends Component {
Tech.techs_ = {};
}

if (!Tech.isTech(tech)) {
throw new Error(`Tech ${name} must be a Tech`)
}

Tech.techs_[name] = tech;
return tech;
}
Expand Down

0 comments on commit 25f7d80

Please sign in to comment.