Skip to content

Commit 9e657ba

Browse files
committed
Fixes #84
Signed-off-by: Rony Xavier <[email protected]>
1 parent bf97131 commit 9e657ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/heimdall_tools/nessus_mapper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def extract_scaninfo
7171
info = {}
7272

7373
info['policyName'] = policy['policyName']
74-
info['version'] = policy['Preferences']['ServerPreferences']['preference'].select { |x| x['name'].eql? 'sc_version' }.first['value']
74+
scanner_version = policy['Preferences']['ServerPreferences']['preference'].select { |x| x['name'].eql? 'sc_version' }
75+
info['version'] = scanner_version.empty? ? NA_STRING : scanner_version.first['value']
7576
info
7677
rescue StandardError => e
7778
raise "Invalid Nessus XML file provided Exception: #{e}"

0 commit comments

Comments
 (0)