From 115f19cf513388c2c9f3c44f7367acfed686a5f6 Mon Sep 17 00:00:00 2001 From: gregor-anich-uibk <63648071+gregor-anich-uibk@users.noreply.github.com> Date: Sat, 8 Aug 2020 13:57:26 +0200 Subject: st7735: Fix handling of unknown commands Command lookup for unknown codes resulted in an exception instead of the 'else' clause which was ineffective. Make the check non-fatal. [ gsi: rephrased commit message ] --- decoders/st7735/pd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decoders/st7735/pd.py b/decoders/st7735/pd.py index 626d2eb..d938a2c 100644 --- a/decoders/st7735/pd.py +++ b/decoders/st7735/pd.py @@ -108,7 +108,7 @@ class Decoder(srd.Decoder): def put_desc(self, ss, es, cmd, data): if cmd == -1: return - if META[cmd]: + if cmd in META: self.put(ss, es, self.out_ann, [Ann.DESC, ['%s: %s' % (META[cmd]['name'].strip(), META[cmd]['desc'])]]) else: -- cgit v1.2.3-70-g09d2