Catch NPE thrown by NetworkInterface.getNetworkInterfaces().

This commit is contained in:
akwizgran
2022-03-05 13:54:48 +00:00
parent f5f7b3eb51
commit 79051439c5
2 changed files with 7 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ public class NetworkUtils {
// Despite what the docs say, the return value can be null
//noinspection ConstantConditions
return ifaces == null ? emptyList() : list(ifaces);
} catch (SocketException e) {
} catch (SocketException | NullPointerException e) {
logException(LOG, WARNING, e);
return emptyList();
}