From 89ed0978174479970bc21fe5254e819c5ada8812 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 2 Jan 2024 19:11:14 +0100 Subject: [PATCH] Small improvement --- app/src/main/java/eu/faircode/email/ConnectionHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ConnectionHelper.java b/app/src/main/java/eu/faircode/email/ConnectionHelper.java index d39f91d575..bea2cfb751 100644 --- a/app/src/main/java/eu/faircode/email/ConnectionHelper.java +++ b/app/src/main/java/eu/faircode/email/ConnectionHelper.java @@ -654,7 +654,7 @@ public class ConnectionHelper { LinkProperties props = (active == null ? null : cm.getLinkProperties(active)); ifacename = (props == null ? null : props.getInterfaceName()); List las = (props == null ? null : props.getLinkAddresses()); - if (las != null) + if (las != null && las.size() > 0) { for (LinkAddress la : las) { InetAddress addr = la.getAddress(); boolean local = (addr.isLoopbackAddress() || addr.isLinkLocalAddress()); @@ -667,7 +667,8 @@ public class ConnectionHelper { else if (addr instanceof Inet6Address) has6 = true; } - return new boolean[]{has4, has6}; + return new boolean[]{has4, has6}; + } } catch (Throwable ex) { Log.e(ex); }