From c008600d085fd2b399b1be25e5dc57dbe8d28b84 Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 28 Jul 2020 14:40:36 +0200 Subject: [PATCH] core/debug: fail if wait_layout is sent without watch_layout --- core/src/apps/debug/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index dc835a66e7..35453a9df8 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -37,7 +37,7 @@ if __debug__: debuglink_decision_chan = loop.chan() layout_change_chan = loop.chan() - current_content = None # type: Optional[List[str]] + current_content = [] # type: List[str] watch_layout_changes = False def screenshot() -> bool: @@ -117,7 +117,9 @@ if __debug__: m.passphrase_protection = passphrase.is_enabled() m.reset_entropy = reset_internal_entropy - if msg.wait_layout or current_content is None: + if msg.wait_layout: + if not watch_layout_changes: + raise wire.ProcessError("Layout is not watched") m.layout_lines = await layout_change_chan.take() else: m.layout_lines = current_content