forked from Boria138/PortProtonQt
fix(get_portproton_start_command): Check if flatpak command exists before trying to run it
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@@ -183,6 +183,22 @@ def get_portproton_start_command():
|
|||||||
if not portproton_path:
|
if not portproton_path:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# Check if flatpak command exists before trying to run it
|
||||||
|
try:
|
||||||
|
subprocess.run(
|
||||||
|
["flatpak", "--version"],
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
check=False,
|
||||||
|
timeout=5
|
||||||
|
)
|
||||||
|
flatpak_available = True
|
||||||
|
except FileNotFoundError:
|
||||||
|
flatpak_available = False
|
||||||
|
except Exception:
|
||||||
|
flatpak_available = False
|
||||||
|
|
||||||
|
if flatpak_available:
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
["flatpak", "list"],
|
["flatpak", "list"],
|
||||||
|
|||||||
Reference in New Issue
Block a user