scripts: dts: gen_driver_kconfig_dts: Skip empty yaml files

The YAML parsing will currently return a None-type if no input data
is empty, and the subsequent check for a substring will cause an
exception.

Signed-off-by: Allan Norgaard <allannk@gmail.com>
This commit is contained in:
Allan Norgaard 2023-01-11 15:38:41 +01:00 committed by Anas Nashif
commit 23cacb3766

View file

@ -80,7 +80,7 @@ def main():
print(f"WARNING: '{binding_path}' appears in binding " print(f"WARNING: '{binding_path}' appears in binding "
f"directories but isn't valid YAML: {e}") f"directories but isn't valid YAML: {e}")
continue continue
if 'compatible' not in raw: if raw is None or 'compatible' not in raw:
continue continue
compat_list.append(raw['compatible']) compat_list.append(raw['compatible'])