Skip operation if there is no active database

master
Matthew Kienow 2019-03-27 13:03:37 -04:00
parent 1981e9be0c
commit 337e061a77
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 5 additions and 0 deletions

View File

@ -86,6 +86,8 @@ module Msf::Payload::UUID::Options
# Store a UUID in the JSON database if tracking is enabled # Store a UUID in the JSON database if tracking is enabled
def record_payload_uuid(uuid, info={}) def record_payload_uuid(uuid, info={})
return unless datastore['PayloadUUIDTracking'] return unless datastore['PayloadUUIDTracking']
# skip if there is no active database
return if !(framework.db && framework.db.active)
uuid_info = info.merge({ uuid_info = info.merge({
uuid: uuid.puid_hex, uuid: uuid.puid_hex,
@ -109,6 +111,9 @@ module Msf::Payload::UUID::Options
# Store a UUID URL in the database if tracking is enabled # Store a UUID URL in the database if tracking is enabled
def record_payload_uuid_url(uuid, url) def record_payload_uuid_url(uuid, url)
return unless datastore['PayloadUUIDTracking'] return unless datastore['PayloadUUIDTracking']
# skip if there is no active database
return if !(framework.db && framework.db.active)
payload_info = { payload_info = {
uuid: uuid.puid_hex, uuid: uuid.puid_hex,
workspace: framework.db.workspace workspace: framework.db.workspace