1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Don't crash in the profile editor when script.db is missing.

This commit is contained in:
david
2012-03-30 07:17:50 +00:00
parent 9c8ff6b3d2
commit be2e413914
2 changed files with 8 additions and 1 deletions

View File

@@ -417,7 +417,10 @@ def get_script_entries(scripts_dir, nselib_dir):
"""Merge the information obtained so far into one single entry for
each script and return it."""
metadata = ScriptMetadata(scripts_dir, nselib_dir)
scriptdb = ScriptDB(os.path.join(scripts_dir, "script.db"))
try:
scriptdb = ScriptDB(os.path.join(scripts_dir, "script.db"))
except IOError:
return []
entries = []
for dbentry in scriptdb.get_entries_list():
entry = metadata.get_metadata(dbentry["filename"])