Skip to content

Commit 029056b

Browse files
committed
misra.py: Add safety check
1 parent 785f324 commit 029056b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

addons/misra.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2702,6 +2702,8 @@ def misra_13_4(self, data):
27022702
continue
27032703
if not token.astParent:
27042704
continue
2705+
if (token.astOperand1 is None) or (token.astOperand2 is None):
2706+
continue
27052707
if token.astOperand1.str == '[' and token.astOperand1.previous.str in ('{', ','):
27062708
continue
27072709
if not (token.astParent.str in [',', ';', '{']):

0 commit comments

Comments
 (0)