|
@@ -111,15 +111,16 @@ class Script(object):
|
|
|
def load_structured_out(self):
|
|
|
Script.structuredOut = {}
|
|
|
if os.path.exists(self.stroutfile):
|
|
|
- with open(self.stroutfile, 'r') as fp:
|
|
|
- try:
|
|
|
- Script.structuredOut = json.load(fp)
|
|
|
- except Exception:
|
|
|
- errMsg = 'Unable to read structured output from ' + self.stroutfile
|
|
|
- self.logger.warn(errMsg)
|
|
|
- pass
|
|
|
-
|
|
|
- # version is only set in a specific way and should not be carried
|
|
|
+ if os.path.getsize(self.stroutfile) > 0:
|
|
|
+ with open(self.stroutfile, 'r') as fp:
|
|
|
+ try:
|
|
|
+ Script.structuredOut = json.load(fp)
|
|
|
+ except Exception:
|
|
|
+ errMsg = 'Unable to read structured output from ' + self.stroutfile
|
|
|
+ self.logger.warn(errMsg)
|
|
|
+ pass
|
|
|
+
|
|
|
+ # version is only set in a specific way and should not be carried
|
|
|
if "version" in Script.structuredOut:
|
|
|
del Script.structuredOut["version"]
|
|
|
# reset security issues and errors found on previous runs
|