From: gregor-anich-uibk Date: Sat, 8 Aug 2020 11:57:26 +0000 (+0200) Subject: st7735: Fix handling of unknown commands X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=115f19cf513388c2c9f3c44f7367acfed686a5f6;p=libsigrokdecode.git 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 ] --- 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: