From 7434f2676de05451a5f7f45839970eb55fb917d4 Mon Sep 17 00:00:00 2001 From: shamsu07 Date: Tue, 13 Jun 2023 19:25:21 +0530 Subject: [PATCH] made changes to handle nonetypes --- surplus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/surplus.py b/surplus.py index d56bdb6..da9d8f5 100644 --- a/surplus.py +++ b/surplus.py @@ -206,7 +206,7 @@ def surplus( # location["address"].get("railway"), ( location["address"].get("building") - if ( + if (location["address"].get("building") and location["address"].get("building") != location["address"].get("house_number") ) @@ -222,7 +222,7 @@ def surplus( ", " + location["address"].get("suburb", "") # dont repeat if suburb is mentioned in the road itself # 'Toa Payoh' in 'Lorong 1A Toa Payoh' - if location["address"].get("suburb", "") + if location["address"].get("suburb", "") and location["address"].get("suburb", "") not in location["address"].get("road") else "" )