mirror of
https://github.com/WowUp/WowUp.git
synced 2026-04-23 23:37:11 -04:00
Merge pull request #370 from linaori/fix/null-pointer-latest-release-gh
Fixed a null pointer when no release is found via "Install from URL"
This commit is contained in:
@@ -57,10 +57,13 @@ export class GitHubAddonProvider implements AddonProvider {
|
||||
|
||||
const results = await this.getReleases(repoPath).toPromise();
|
||||
const latestRelease = this.getLatestRelease(results);
|
||||
const asset = this.getValidAsset(latestRelease, clientType);
|
||||
if (!latestRelease) {
|
||||
throw new Error(`No release found in ${addonUri}`);
|
||||
}
|
||||
|
||||
const asset = this.getValidAsset(latestRelease, clientType);
|
||||
if (asset == null) {
|
||||
throw new Error(`No release found: ${addonUri}`);
|
||||
throw new Error(`No release assets found in ${addonUri}`);
|
||||
}
|
||||
|
||||
var repository = await this.getRepository(repoPath).toPromise();
|
||||
|
||||
Reference in New Issue
Block a user