mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
[flatpak] improvement: preventing null pointer crashes if the search command raises an exception
This commit is contained in:
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
### Improvements
|
### Improvements
|
||||||
- General
|
- General
|
||||||
- preventing command injection through the search mechanism [#266](https://github.com/vinifmor/bauh/issues/266)
|
- preventing command injection through the search mechanism [#266](https://github.com/vinifmor/bauh/issues/266)
|
||||||
|
- code refactoring
|
||||||
|
|
||||||
- UI
|
- UI
|
||||||
- manage window minimum width related to the table columns
|
- manage window minimum width related to the table columns
|
||||||
|
|||||||
@@ -326,15 +326,18 @@ def get_app_commits_data(app_ref: str, origin: str, installation: str, full_str:
|
|||||||
return commits
|
return commits
|
||||||
|
|
||||||
|
|
||||||
def search(version: Version, word: str, installation: str, app_id: bool = False) -> List[dict]:
|
def search(version: Version, word: str, installation: str, app_id: bool = False) -> Optional[List[dict]]:
|
||||||
|
|
||||||
res = run_cmd(f'flatpak search {word} --{installation}', lang=None)
|
res = run_cmd(f'flatpak search {word} --{installation}', lang=None)
|
||||||
|
|
||||||
found = []
|
if not res:
|
||||||
|
return
|
||||||
|
|
||||||
|
found = None
|
||||||
split_res = res.strip().split('\n')
|
split_res = res.strip().split('\n')
|
||||||
|
|
||||||
if split_res and '\t' in split_res[0]:
|
if split_res and '\t' in split_res[0]:
|
||||||
|
found = []
|
||||||
for info in split_res:
|
for info in split_res:
|
||||||
if info:
|
if info:
|
||||||
info_list = info.split('\t')
|
info_list = info.split('\t')
|
||||||
|
|||||||
Reference in New Issue
Block a user