summaryrefslogtreecommitdiffstats
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)
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 ade3e38059..89dd278b7e 100644
--- a/lib/python/qmk/c_parse.py
+++ b/lib/python/qmk/c_parse.py
@@ -67,8 +67,10 @@ def find_layouts(file):
layout = layout.strip()
parsed_layout = [_default_key(key) for key in layout.split(',')]
- for key in parsed_layout:
- if key['label'] in matrix_locations:
+ for i, key in enumerate(parsed_layout):
+ if 'label' not in key:
+ cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i)
+ elif key['label'] in matrix_locations:
key['matrix'] = matrix_locations[key['label']]
parsed_layouts[macro_name] = {