Skip to content

Commit 1d2af06

Browse files
committed
Fix bug with updating loot type
1 parent 542e8a3 commit 1d2af06

File tree

1 file changed

+5
-2
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+5
-2
lines changed

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,15 +1235,18 @@ def cmd_loot(*args)
12351235
end
12361236

12371237
loots.each do |loot|
1238-
next if types and types.index(loot.ltype).nil?
12391238
row = []
12401239
# TODO: This is just a temp implementation of update for the time being since it did not exist before.
12411240
# It should be updated to not pass all of the attributes attached to the object, only the ones being updated.
12421241
if mode == :update
12431242
begin
12441243
loot.info = info if info
12451244
loot.filename = filename if filename
1246-
loot.ltype = types if types
1245+
if types.size > 1
1246+
print_error "May only pass 1 type when performing an update."
1247+
next
1248+
end
1249+
loot.ltype = types.first if types
12471250
framework.db.update_loot(loot.as_json.symbolize_keys)
12481251
rescue Exception => e
12491252
elog "There was an error updating loot with ID #{loot.id}: #{e.message}"

0 commit comments

Comments
 (0)