From dfb8a9e24b4148521aed03858775f863c7ca2d59 Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Sat, 30 Apr 2011 04:33:52 +0000 Subject: [PATCH] Catching more nils in db_import. git-svn-id: file:///home/svn/framework3/trunk@12477 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/db.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/db.rb b/lib/msf/core/db.rb index 3a33cfd89c..ea17d13c0f 100644 --- a/lib/msf/core/db.rb +++ b/lib/msf/core/db.rb @@ -3312,6 +3312,7 @@ class DBManager next if v["status"] !~ /^vulnerable/ vstruct = vstructs.select {|vs| vs.id.to_s.downcase == v["id"].to_s.downcase}.first + next unless vstruct data = {} data[:workspace] = wspace data[:host] = hobj || addr @@ -4578,10 +4579,10 @@ class DBManager end def unserialize_object(xml_elem, allow_yaml = false) + return nil unless xml_elem string = xml_elem.text.to_s.strip return string unless string.is_a?(String) - return nil if not string - return nil if string.empty? + return nil if (string.empty? || string.nil?) begin # Validate that it is properly formed base64 first