Skip to content

Commit e197f53

Browse files
committed
Check the path is set before checking the file exists
1 parent 947a0ed commit e197f53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/core/modules/metadata/store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def load_metadata
5656
retries +=1
5757

5858
# Try to handle the scenario where the file is corrupted
59-
if (retries < 2 && ::File.exist?(@path_to_user_metadata))
59+
if retries < 2 && @path_to_user_metadata && ::File.exist?(@path_to_user_metadata)
6060
elog('Possible corrupt user metadata store, attempting restore')
6161
FileUtils.remove(@path_to_user_metadata)
6262
retry

0 commit comments

Comments
 (0)