Run __contains__ only if instance of dict_node
@@ -46,7 +46,7 @@ class Runner(BaseRunner):
logging.info(f'CloudFormation skipping {file} as it is not a valid CF template')
# Filter out empty files that have not been parsed successfully, and filter out non-CF template files
- definitions = {k: v for k, v in definitions.items() if v and v.__contains__("Resources")}
+ definitions = {k: v for k, v in definitions.items() if v and isinstance(v, dict_node) and v.__contains__("Resources")}
definitions_raw = {k: v for k, v in definitions_raw.items() if k in definitions.keys()}
for cf_file in definitions.keys():
