Detect empty imports

git-svn-id: file:///home/svn/framework3/trunk@11355 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-12-16 21:26:39 +00:00
parent 3d52c5c4c0
commit 743cdba360
1 changed files with 5 additions and 0 deletions

View File

@ -1963,6 +1963,11 @@ class DBManager
# :amap_log :ip_list, :msf_zip, :libpcap
# If there is no match, an error is raised instead.
def import_filetype_detect(data)
if not (data and data.length > 0)
raise DBImportError.new("The data provided to the import function was empty")
end
if data.kind_of? Zip::ZipFile
raise DBImportError.new("The zip file provided is empty.") if data.entries.empty?
@import_filedata ||= {}