]> sigrok.org Git - libsigrokdecode.git/commitdiff
st7735: Fix handling of unknown commands
authorgregor-anich-uibk <redacted>
Sat, 8 Aug 2020 11:57:26 +0000 (13:57 +0200)
committerGerhard Sittig <redacted>
Sun, 9 Aug 2020 04:50:37 +0000 (06:50 +0200)
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

index 626d2eb16d2c4d3ca3ebe3ba6ecba989b9a399ba..d938a2c52b8840b070401a740d2eb81a42c00698 100644 (file)
@@ -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: