[appimage] fix: trying to download a file without a URL associated with

This commit is contained in:
Vinicius Moreira
2021-11-25 13:48:20 -03:00
parent 99595dfbb2
commit 6875d62a16
11 changed files with 19 additions and 0 deletions

View File

@@ -512,6 +512,13 @@ class AppImageManager(SoftwareManager):
def _download(self, pkg: AppImage, watcher: ProcessWatcher) -> Optional[Tuple[str, str]]:
appimage_url = pkg.url_download_latest_version if pkg.update else pkg.url_download
if not appimage_url:
watcher.show_message(title=self.i18n['error'],
body=self.i18n['appimage.download.no_url'].format(app=bold(pkg.name)),
type_=MessageType.ERROR)
return
file_name = appimage_url.split('/')[-1]
pkg.version = pkg.latest_version
pkg.url_download = appimage_url