mirror of
https://github.com/lutris/lutris
synced 2024-10-14 19:53:53 +00:00
Avoid crash if lsblk output can't be read
This commit is contained in:
parent
73863761e0
commit
238b20da83
|
@ -164,6 +164,8 @@ class LinuxSystem: # pylint: disable=too-many-public-methods
|
||||||
def get_drives():
|
def get_drives():
|
||||||
"""Return a list of drives with their filesystems"""
|
"""Return a list of drives with their filesystems"""
|
||||||
lsblk_output = system.read_process_output(["lsblk", "-f", "--json"])
|
lsblk_output = system.read_process_output(["lsblk", "-f", "--json"])
|
||||||
|
if not lsblk_output:
|
||||||
|
return []
|
||||||
return [
|
return [
|
||||||
drive
|
drive
|
||||||
for drive in json.loads(lsblk_output)["blockdevices"]
|
for drive in json.loads(lsblk_output)["blockdevices"]
|
||||||
|
|
Loading…
Reference in a new issue