Skip to content

Commit b9e5cfb

Browse files
committed
Core: Protect from clearing a non-existant cache
Issue kindly raised by @garanews, thanks! 5:D
1 parent 8e56cb3 commit b9e5cfb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

volatility3/framework/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,7 @@ def list_plugins() -> Dict[str, Type[interfaces.plugins.PluginInterface]]:
224224

225225

226226
def clear_cache(complete=False):
227-
os.unlink(os.path.join(constants.CACHE_PATH, constants.IDENTIFIERS_FILENAME))
227+
try:
228+
os.unlink(os.path.join(constants.CACHE_PATH, constants.IDENTIFIERS_FILENAME))
229+
except FileNotFoundError:
230+
vollog.log(constants.LOGLEVEL_VVVV, "Attempting to clear a non-existant cache")

0 commit comments

Comments
 (0)