You should do 
```
if list_item_style is None:
    continue
```
Instead. For all of the nested if's in the block of code actually.