Don't attempt to pull from empty cache file

Change-Id: Id26e954f347c35703e506abdc8ecf5146f2efb61
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2010155
Task: 45808
This commit is contained in:
Stephen Finucane 2022-07-19 13:50:00 +01:00
parent 9700000b35
commit aae5632aa1
1 changed files with 1 additions and 0 deletions

View File

@ -73,6 +73,7 @@ class Loader(object):
with open(self._cache_filename, 'r', encoding=self._encoding) as f:
self._cache = yaml.safe_load(f.read())
if self._cache:
# Save the cached scanner output to the same attribute
# it would be in if we had loaded it "live". This
# simplifies some of the logic in the other methods.