Commit 91fae040 authored by PidgeyL's avatar PidgeyL
Browse files

bugfix for 'empty collection'

parent 0d1f878b
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -64,18 +64,19 @@ else:
batch = []

# skip on empty collections
if not list(collections):
col=list(collections)
if not col:
    print ("Empty collections, import skipped")
    sys.exit(2)

for item in progressbar(list(collections)):
for item in progressbar(col):
    for cpeentry in item['vulnerable_configuration']:
        checkdup = cpeother.find(({'id': cpeentry}))
        if checkdup.count() <= 0:
            entry = cpe.find(({'id': cpeentry}))
            if entry.count() <= 0:
                title = cpeentry
                title = title[7:]
                title = title[10:]
                title = title.replace(':-:', ' ',10)
                title = title.replace(':', ' ',10)
                title = title.replace('_', ' ',10)