misra.py: Fix R21.1 crash on C++ code (#2354)
Variables from cppcheckdata.Variable have no nameToken if they are objects of user-defined classes.
This commit is contained in:
parent
49d6bfbd7b
commit
dbe23f878b
|
@ -1916,6 +1916,8 @@ class MisraChecker:
|
|||
token = i.nameToken
|
||||
elif isinstance(i, cppcheckdata.Function):
|
||||
token = i.tokenDef
|
||||
if not token:
|
||||
continue
|
||||
if len(token.str) < 2:
|
||||
continue
|
||||
if token.str == 'errno':
|
||||
|
|
Loading…
Reference in New Issue