Check DB is active before querying sessions

GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-09-13 15:06:53 -04:00
parent fe7a832aa8
commit 6a6d92abc1
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 6 additions and 4 deletions

View File

@ -620,12 +620,14 @@ class ReadableText
'Indent' => indent,
'SortIndex' => 1)
if framework.db.active
framework.db.sessions.each do |session|
unless session.closed_at.nil?
row = create_mdm_session_row(session, show_extended)
tbl << row
end
end
end
output << (tbl.rows.count > 0 ? tbl.to_s : "#{tbl.header_to_s}No inactive sessions.\n")
end