summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorgregor-anich-uibk <63648071+gregor-anich-uibk@users.noreply.github.com>2020-08-08 13:57:26 +0200
committerGerhard Sittig <gerhard.sittig@gmx.net>2020-08-09 06:50:37 +0200
commit115f19cf513388c2c9f3c44f7367acfed686a5f6 (patch)
tree5690ea0aa3c7f08f0bfd7653f21f86731ce52554 /decoders
parent9b0ad5177bd692f7556a4756bdbd2da81d9c34ce (diff)
downloadlibsigrokdecode-115f19cf513388c2c9f3c44f7367acfed686a5f6.tar.gz
libsigrokdecode-115f19cf513388c2c9f3c44f7367acfed686a5f6.zip
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 ]
Diffstat (limited to 'decoders')
-rw-r--r--decoders/st7735/pd.py2
1 files changed, 1 insertions, 1 deletions
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: