was missing a nil check

unstable
David Maloney 2013-06-04 14:21:07 -05:00
parent a40b6a3569
commit 2e26256217
2 changed files with 9 additions and 2 deletions

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130531144949) do
ActiveRecord::Schema.define(:version => 20130604145732) do
create_table "api_keys", :force => true do |t|
t.text "token"
@ -440,6 +440,13 @@ ActiveRecord::Schema.define(:version => 20130531144949) do
t.datetime "updated_at", :null => false
end
create_table "task_sessions", :force => true do |t|
t.integer "task_id", :null => false
t.integer "session_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "tasks", :force => true do |t|
t.integer "workspace_id", :default => 1, :null => false
t.string "created_by"

View File

@ -786,7 +786,7 @@ class DBManager
s = ::Mdm::Session.new(sess_data)
s.save!
if session.exploit_task and session.exploit_task.record
if session and session.exploit_task and session.exploit_task.record
session_task = session.exploit_task.record
if session_task.class == Mdm::Task
Mdm::TaskSession.create(:task => session_task, :session => s )