mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Catch NPE from NetworkInterface.getByInetAddress().
This commit is contained in:
@@ -201,6 +201,7 @@ class AndroidLanTcpPlugin extends LanTcpPlugin {
|
||||
@Nullable
|
||||
private InetAddress getIpv6AddressForInterface(InetAddress ipv4) {
|
||||
try {
|
||||
// We may get an NPE from getByInetAddress() on Android 11
|
||||
NetworkInterface iface = NetworkInterface.getByInetAddress(ipv4);
|
||||
if (iface == null) return null;
|
||||
for (InetAddress addr : list(iface.getInetAddresses())) {
|
||||
@@ -208,7 +209,7 @@ class AndroidLanTcpPlugin extends LanTcpPlugin {
|
||||
}
|
||||
// No suitable address
|
||||
return null;
|
||||
} catch (SocketException e) {
|
||||
} catch (SocketException | NullPointerException e) {
|
||||
logException(LOG, WARNING, e);
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user