Skip to content

Commit 808ab04

Browse files
authored
Merge pull request #361 from ShionKanagawa/main
Fix: Prevent crash in get_boot_logo_status if file is missing
2 parents f559df0 + d23fd87 commit 808ab04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/legion_linux/legion_linux/legion.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,12 @@ def _check_image_dimensions_and_format(self, image_path, expected_width, expecte
15061506
return img_width, img_height, img_format
15071507

15081508
def get_boot_logo_status(self):
1509-
data = self._read_file(LBLDESP_FILE)
1509+
try:
1510+
data = self._read_file(LBLDESP_FILE)
1511+
except (IOError, OSError) as e:
1512+
log.warning(f"Could not read LBLDESP_FILE ({LBLDESP_FILE}): {e}")
1513+
return False, 0, 0
1514+
15101515
if len(data) < 13:
15111516
log.warning("LBLDESP data is unexpectedly short.")
15121517
return False, 0, 0

0 commit comments

Comments
 (0)