aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2021-02-24 10:35:08 -0800
committerZach White <skullydazed@drpepper.org>2021-02-24 16:47:38 -0800
commit23ef327e118307d276677d30e3fda064ace6713b (patch)
tree7a1c79714c37556c4f07bb0b5f5aca79057daa2f /lib/python
parentba0b965c429da08c36d3aeb5cc8d93392720ff92 (diff)
downloadqmk_firmware-23ef327e118307d276677d30e3fda064ace6713b.tar.gz
qmk_firmware-23ef327e118307d276677d30e3fda064ace6713b.zip
make LAYOUT parsing more robust
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/qmk/c_parse.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py
index ade3e3805..89dd278b7 100644
--- a/lib/python/qmk/c_parse.py
+++ b/lib/python/qmk/c_parse.py
@@ -67,8 +67,10 @@ def find_layouts(file):
67 layout = layout.strip() 67 layout = layout.strip()
68 parsed_layout = [_default_key(key) for key in layout.split(',')] 68 parsed_layout = [_default_key(key) for key in layout.split(',')]
69 69
70 for key in parsed_layout: 70 for i, key in enumerate(parsed_layout):
71 if key['label'] in matrix_locations: 71 if 'label' not in key:
72 cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i)
73 elif key['label'] in matrix_locations:
72 key['matrix'] = matrix_locations[key['label']] 74 key['matrix'] = matrix_locations[key['label']]
73 75
74 parsed_layouts[macro_name] = { 76 parsed_layouts[macro_name] = {