1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

check for key in dictionary

This commit is contained in:
Kelly Brazil
2020-07-24 13:47:47 -07:00
parent 8444690133
commit d0b7ea68a0

View File

@ -331,7 +331,7 @@ def process(proc_data):
int_list = ['hop', 'asn']
float_list = ['rtt']
if proc_data['hops']:
if 'hops' in proc_data:
for entry in proc_data['hops']:
for key in int_list:
if key in entry:
@ -347,7 +347,7 @@ def process(proc_data):
except (ValueError, TypeError):
entry[key] = None
if entry['probes']:
if 'probes' in entry:
for item in entry['probes']:
for key in int_list:
if key in item: