Skip to content

Commit

Permalink
Merge pull request #1 from snapshotleisure/snapshotleisure-patch-2
Browse files Browse the repository at this point in the history
Fixing convert_to_list function to handle input None
  • Loading branch information
snapshotleisure authored Nov 13, 2023
2 parents f8f6659 + c10e48d commit ba3b019
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions SPECS/ansible/tdnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,15 @@ def convert_to_list(input_list):
"""Convert nested list into flat list"""
flat_list = []

if input_list is not None:
for sublist in input_list:
if not isinstance(sublist, list):
flat_list.append(sublist)
continue
if sublist is not None:
for item in sublist:
flat_list.append(item)
if not input_list:
return flat_list

for sublist in input_list:
if not isinstance(sublist, list):
flat_list.append(sublist)
continue
for item in sublist:
flat_list.append(item)

return flat_list

Expand Down

0 comments on commit ba3b019

Please sign in to comment.