From 9e60c442f92205ecd4b3cdec5ab8379a841e2b6a Mon Sep 17 00:00:00 2001 From: Zach White Date: Wed, 24 Feb 2021 10:35:08 -0800 Subject: [PATCH] make LAYOUT parsing more robust --- lib/python/qmk/c_parse.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py index ade3e3805965..89dd278b7e92 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] = {