gracefully handle info url failures - fixes #12
This commit is contained in:
parent
1548e394d6
commit
372941bafe
@ -171,7 +171,8 @@ const get = async name => {
|
||||
const getInfoUrl = ({repository, homepage}) => {
|
||||
if (repository) {
|
||||
const gitUrl = typeof repository === "string" ? repository : repository.url;
|
||||
return require("hosted-git-info").fromUrl(gitUrl).browse();
|
||||
const info = require("hosted-git-info").fromUrl(gitUrl);
|
||||
if (info && info.browse) return info.browse();
|
||||
}
|
||||
|
||||
return homepage || "";
|
||||
|
Loading…
Reference in New Issue
Block a user