Skip to content

Commit

Permalink
Merge pull request #24 from Exabyte-io/chore/SOF-6552
Browse files Browse the repository at this point in the history
chore/SOF-6552
  • Loading branch information
timurbazhirov committed May 15, 2023
2 parents ccf4f34 + b7e116f commit ea9c83c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export function getAllApplications(cls = null) {
*/
export function getApplication({ applicationsTree, name, version = null, build = "Default" }) {
const app = applicationsTree[name];
// eslint-disable-next-line no-param-reassign
if (!version) version = app.defaultVersion;
return app[version][build];
const version_ = version || app.defaultVersion;
if (!app[version_]) console.log(`Version ${version_} not available for ${name} !`);
return app[version_]?.[build];
}

const { applicationsTree } = getAllApplications(null);
Expand Down

0 comments on commit ea9c83c

Please sign in to comment.