kernel_hardening_checker/engine.py:119: error: "None" has no attribute "startswith" [attr-defined]
The `json_dump()` function printing the results should not be called
for the OptCheck and ComplexOptCheck objects with empty results.
"reason": self.reason,
}
if with_results:
+ assert self.result, f'unexpected empty result in {self.name}'
dump["check_result"] = self.result
dump["check_result_bool"] = self.result.startswith('OK')
return dump
dump = self.opts[0].json_dump(False)
if with_results:
# Add the 'check_result' and 'check_result_bool' keys to the dictionary
+ assert self.result, f'unexpected empty result in {self.name}'
dump["check_result"] = self.result
dump["check_result_bool"] = self.result.startswith('OK')
return dump