Skip to content

Commit 08cd269

Browse files
committed
Merge branch 'bug/MSP-10724/fix-import-failure' into staging/electro-release MSP-10724 #land
2 parents fd2a12d + e789d53 commit 08cd269

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lib/msf/core/db.rb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,6 @@ def report_note(opts)
13721372
=end
13731373
ntype = opts.delete(:type) || opts.delete(:ntype) || (raise RuntimeError, "A note :type or :ntype is required")
13741374
data = opts[:data]
1375-
method = nil
1376-
args = []
13771375
note = nil
13781376

13791377
conditions = { :ntype => ntype }
@@ -1382,15 +1380,7 @@ def report_note(opts)
13821380

13831381
case mode
13841382
when :unique
1385-
notes = wspace.notes.where(conditions)
1386-
1387-
# Only one note of this type should exist, make a new one if it
1388-
# isn't there. If it is, grab it and overwrite its data.
1389-
if notes.empty?
1390-
note = wspace.notes.new(conditions)
1391-
else
1392-
note = notes[0]
1393-
end
1383+
note = wspace.notes.where(conditions).first_or_initialize
13941384
note.data = data
13951385
when :unique_data
13961386
notes = wspace.notes.where(conditions)

0 commit comments

Comments
 (0)