From 02d0d91df9990553a08b54f3d8d34fb9790725e2 Mon Sep 17 00:00:00 2001 From: Nemunaire Date: Mon, 5 May 2014 17:52:55 +0200 Subject: [PATCH] Networking module: avoid error on unexiststant registrant, administrativeContact or technicalContact --- modules/networking.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/networking.py b/modules/networking.py index 6d64739..f74aa51 100644 --- a/modules/networking.py +++ b/modules/networking.py @@ -129,9 +129,9 @@ def cmd_whois(msg): "\x03\x02created on\x03\x02 " + extractdate(whois["createdDate"]).strftime("%c") + ", " if "createdDate" in whois else "", "\x03\x02updated on\x03\x02 " + extractdate(whois["updatedDate"]).strftime("%c") + ", " if "updatedDate" in whois else "", "\x03\x02expires on\x03\x02 " + extractdate(whois["expiresDate"]).strftime("%c") + ", " if "expiresDate" in whois else "", - whois_entityformat(whois["registrant"]), - whois_entityformat(whois["administrativeContact"]), - whois_entityformat(whois["technicalContact"]), + whois_entityformat(whois["registrant"]) if "registrant" in whois else "unknown", + whois_entityformat(whois["administrativeContact"]) if "administrativeContact" in whois else "unknown", + whois_entityformat(whois["technicalContact"]) if "technicalContact" in whois else "unknown", )) return res