From 7728c53cb910969eb68358dc199a985ba7a9a62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 19 Mar 2022 10:36:46 +0100 Subject: [PATCH] Addons: Variable.constness will never be None --- addons/cppcheckdata.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index 08ba73d94..0a2a51f35 100755 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -620,9 +620,11 @@ class Variable: self.isPointer = element.get('isPointer') == 'true' self.isReference = element.get('isReference') == 'true' self.isStatic = element.get('isStatic') == 'true' - self.constness = element.get('constness') - if self.constness: - self.constness = int(self.constness) + constness = element.get('constness') + if constness: + self.constness = int(constness) + else: + self.constness = 0 def __repr__(self): attrs = ["Id", "nameTokenId", "typeStartTokenId", "typeEndTokenId",