From 7294cc2d2958ea03d22fca1836f49528820da856 Mon Sep 17 00:00:00 2001 From: rev3rsesecurity <36775664+Rev3rseSecurity@users.noreply.github.com> Date: Mon, 22 Oct 2018 12:40:38 +0000 Subject: [PATCH] fix bug on xml with no host up --- views.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/views.py b/views.py index 21383fa..846f43e 100644 --- a/views.py +++ b/views.py @@ -262,16 +262,24 @@ def index(request, filterservice="", filterportid=""): r['out2'] = json.dumps(oo['nmaprun'], indent=4) o = json.loads(r['out2']) - if type(o['host']) is not dict: - hostnum = str(len(o['host'])) + if 'host' in o: + if type(o['host']) is not dict: + hostnum = str(len(o['host'])) + else: + hostnum = '1' + else: + hostnum = '0' + + if hostnum != '0': + viewhref = '/setscanfile/'+html.escape(i) else: - hostnum = '1' + viewhref = '/" disabled="disabled' r['trhost'] += '