misra.py: Add safety check

This commit is contained in:
Daniel Marjamäki 2023-04-17 17:21:02 +02:00
parent 785f32465f
commit 029056b0b4
1 changed files with 2 additions and 0 deletions

View File

@ -2702,6 +2702,8 @@ class MisraChecker:
continue
if not token.astParent:
continue
if (token.astOperand1 is None) or (token.astOperand2 is None):
continue
if token.astOperand1.str == '[' and token.astOperand1.previous.str in ('{', ','):
continue
if not (token.astParent.str in [',', ';', '{']):