hackertarget / nmap-did-what

Nmap Dashboard Mini Project
GNU General Public License v2.0
534 stars 98 forks source link

Fix: AttributeError: 'NoneType' object has no attribute 'findall' #9

Closed KINGSABRI closed 5 months ago

KINGSABRI commented 5 months ago

This is a fix for the following error:

Traceback (most recent call last):
  File "/home/user/rt/nmap-did-what/data/nmap-to-sqlite.py", line 220, in <module>
    main()
  File "/home/user/rt/nmap-did-what/data/nmap-to-sqlite.py", line 213, in main
    scan, hosts = parse_nmap_xml(xml_file)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/rt/nmap-did-what/data/nmap-to-sqlite.py", line 52, in parse_nmap_xml
    for port in host.find('ports').findall('port'):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'findall'