gisi: return NULL instead of asserting
authorMika Liljeberg <mika.liljeberg@nokia.com>
Wed, 10 Nov 2010 12:22:29 +0000 (14:22 +0200)
committerAki Niemi <aki.niemi@nokia.com>
Thu, 11 Nov 2010 07:23:33 +0000 (09:23 +0200)
gisi/pep.c

index f1ff589..bea1902 100644 (file)
@@ -148,6 +148,8 @@ unsigned g_isi_pep_get_ifindex(const GIsiPEP *pep)
 
 char *g_isi_pep_get_ifname(const GIsiPEP *pep, char *ifname)
 {
-       unsigned ifi = g_isi_pep_get_ifindex(pep);
-       return if_indextoname(ifi, ifname);
+       if (pep->gprs_fd == -1)
+               return NULL;
+
+       return if_indextoname(g_isi_pep_get_ifindex(pep), ifname);
 }