Skip to content

Commit 2e26256

Browse files
David MaloneyDavid Maloney
authored andcommitted
was missing a nil check
1 parent a40b6a3 commit 2e26256

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

db/schema.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20130531144949) do
14+
ActiveRecord::Schema.define(:version => 20130604145732) do
1515

1616
create_table "api_keys", :force => true do |t|
1717
t.text "token"
@@ -440,6 +440,13 @@
440440
t.datetime "updated_at", :null => false
441441
end
442442

443+
create_table "task_sessions", :force => true do |t|
444+
t.integer "task_id", :null => false
445+
t.integer "session_id", :null => false
446+
t.datetime "created_at", :null => false
447+
t.datetime "updated_at", :null => false
448+
end
449+
443450
create_table "tasks", :force => true do |t|
444451
t.integer "workspace_id", :default => 1, :null => false
445452
t.string "created_by"

lib/msf/core/db.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def report_session(opts)
786786
s = ::Mdm::Session.new(sess_data)
787787
s.save!
788788

789-
if session.exploit_task and session.exploit_task.record
789+
if session and session.exploit_task and session.exploit_task.record
790790
session_task = session.exploit_task.record
791791
if session_task.class == Mdm::Task
792792
Mdm::TaskSession.create(:task => session_task, :session => s )

0 commit comments

Comments
 (0)