Add explicit ISO guard to restore_console_font

Matches the existing guards in _set_font and save_console_font.
Behaviour was already safe implicitly via _font_backup=None, but
the explicit check makes intent obvious at the call site.
This commit is contained in:
Softer 2026-04-20 12:56:11 +03:00
parent 4c0773cf54
commit a973ca05c3
1 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,9 @@ class TranslationHandler:
def restore_console_font(self) -> None:
"""Restore console font (with unicode map) and console map from backup."""
if not running_from_iso():
return
if self._font_backup is None or not self._font_backup.exists():
return