Skip to content

Commit 2f56208

Browse files
author
Ives van Hoorne
committed
Catch error for invalid semvers
1 parent abc7f3b commit 2f56208

File tree

1 file changed

+7
-3
lines changed
  • packages/app/src/app/pages/Sandbox/SearchDependencies/DependencyHit

1 file changed

+7
-3
lines changed

packages/app/src/app/pages/Sandbox/SearchDependencies/DependencyHit/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ export default class DependencyHit extends React.PureComponent {
6060
}
6161
}
6262

63-
const versions = Object.keys(hit.versions).sort((a: string, b: string) =>
64-
compareVersions(b, a)
65-
);
63+
const versions = Object.keys(hit.versions).sort((a: string, b: string) => {
64+
try {
65+
return compareVersions(b, a);
66+
} catch (e) {
67+
return 0;
68+
}
69+
});
6670

6771
return (
6872
<Container highlighted={highlighted} onClick={onClick}>

0 commit comments

Comments
 (0)