lookup-apn: Fix crash on no APNs found

This commit is contained in:
Oleg Zhurakivskyy 2011-10-05 16:18:30 +03:00 committed by Denis Kenzior
parent 9534fcfac8
commit fda1e1cc71
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,11 @@ static void lookup_apn(const char *match_mcc, const char *match_mnc)
apns = mbpi_lookup(match_mcc, match_mnc, TRUE, &error);
if (apns == NULL) {
g_print("Lookup failed: %s\n", error->message);
if (error != NULL) {
g_printerr("Lookup failed: %s\n", error->message);
g_error_free(error);
}
return;
}