Skip to content

Commit

Permalink
Return early from function
Browse files Browse the repository at this point in the history
Former-commit-id: c8b4d2d
  • Loading branch information
ycombinator committed Jul 5, 2016
1 parent d8a7253 commit e603442
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ui/public/chrome/api/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ export default function (chrome, internals) {

chrome.getNavLinkById = (id) => {
const navLink = internals.nav.find(link => link.id === id);
if (navLink) {
return navLink;
} else {
if (!navLink) {
throw new Error(`Nav link for id = ${id} not found`);
}
return navLink;
};

chrome.getBasePath = function () {
Expand Down

0 comments on commit e603442

Please sign in to comment.