[flatpak] fix -> crashing when an update size cannot be read

This commit is contained in:
Vinicius Moreira
2020-08-12 11:56:42 -03:00
parent dd8683063b
commit a027412842
2 changed files with 7 additions and 1 deletions

View File

@@ -41,6 +41,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Flatpak
- downgrading crashing with version 1.8.X
- history: the top commit is returned as "(null)" in version 1.8.X
- crashing when an update size cannot be read [#130](https://github.com/vinifmor/bauh/issues/130)
- installation fails when there are multiple references for a given package (e.g: openh264)
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/releases/0.9.7/flatpak_refs.png">

View File

@@ -415,5 +415,10 @@ def map_update_download_size(app_ids: Iterable[str], installation: str, version:
if related_id:
size = p2.findall(line_split[6])[0].split('?')
res[related_id[0].strip()] = size_to_byte(float(size[0]), size[1])
if size and len(size) > 1:
try:
res[related_id[0].strip()] = size_to_byte(float(size[0]), size[1])
except:
traceback.print_exc()
return res