From 766577bb2621856251f0f524de4a26afc75cb246 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 9 Sep 2022 14:21:42 +0000 Subject: [PATCH] tests: country: Don't crash when a country could not be found Signed-off-by: Michael Tremer --- src/test-country.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test-country.c b/src/test-country.c index 9820e8b..f9db204 100644 --- a/src/test-country.c +++ b/src/test-country.c @@ -145,7 +145,7 @@ int main(int argc, char** argv) { // Lookup an address in the subnet err = loc_database_get_country(db, &country, "YY"); - if (err) { + if (err || !country) { fprintf(stderr, "Could not find country: YY\n"); exit(EXIT_FAILURE); } -- 2.39.5