From 55a7ff311622849060e849349d42530f683116c9 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Fri, 5 Jun 2020 14:03:58 -0700 Subject: [PATCH] Moved leading/trailing slash check to prevent NoneType Errors --- py-json/LANforge/LFRequest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 24213ae5..022861ab 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -27,9 +27,9 @@ class LFRequest: if "http://" not in url or "https://" not in url: print("No http:// or https:// found, prepending http://") url = "http://" + url - if not url.endswith('/') and not uri.startswith('/'): - url += '/' if uri is not None: + if not url.endswith('/') and not uri.startswith('/'): + url += '/' self.requested_url = url + uri if self.requested_url.find('//'): protopos = self.requested_url.find("://")