From 0311c4142257b22ffaf81bf60d3f4e4c8acf4be4 Mon Sep 17 00:00:00 2001 From: Kira <38155247+Nyanraltotlapun@users.noreply.github.com> Date: Tue, 30 Dec 2025 01:27:40 +0100 Subject: [PATCH] Fix panic when country code is not in db. --- src/get_near_countries.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/get_near_countries.py b/src/get_near_countries.py index aef8844..59eb54d 100755 --- a/src/get_near_countries.py +++ b/src/get_near_countries.py @@ -213,11 +213,12 @@ def main(): if recursion_depth > 12: sys.exit("Recursion should be less than or equal 12! You doing something stupid here.") - result = set(NEAR_COUNTRIES[search_country]) + + result = set(NEAR_COUNTRIES.get(search_country,[])) for i in range(1, recursion_depth, 1): n_c = list(result) for country in n_c: - result.update(NEAR_COUNTRIES[country]) + result.update(NEAR_COUNTRIES.get(country,[])) list_result = list(result) list_result.sort()