You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a few automated crash reports with this stack trace, with getHostAddress() called in a ServiceListener.serviceResolved() callback:
Caused by: java.lang.NullPointerException
at javax.jmdns.impl.ServiceInfoImpl.getHostAddresses(ServiceInfoImpl.java:420)
at javax.jmdns.impl.ServiceInfoImpl.getHostAddress(ServiceInfoImpl.java:404)
looking at getHostAddresses():
@Override
public String[] getHostAddresses() {
Inet4Address[] ip4Aaddresses = this.getInet4Addresses();
Inet6Address[] ip6Aaddresses = this.getInet6Addresses();
String[] names = new String[ip4Aaddresses.length + ip6Aaddresses.length];
for (int i = 0; i < ip4Aaddresses.length; i++) {
names[i] = ip4Aaddresses[i].getHostAddress();
}
for (int i = 0; i < ip6Aaddresses.length; i++) {
names[i + ip4Aaddresses.length] = "[" + ip6Aaddresses[i].getHostAddress() + "]";
}
return names;
}
The only possible thing null on that line is ip6Aaddresses[i].
So I suppose getInet6Addresses() can return an Inet6Address[] where some elements are null.
I have not checked if v3.5.8 would fix this issue but I doubt it.
Anyway, since my program does not make use of ipv6 at all, I worked-around this issue issue calling ServiceInfoImpl.getInet4Address().getHostAddress().
Still it would be nice to get the bottom line of that NPE.
The text was updated successfully, but these errors were encountered:
jmdns version: 3.5.6.
I've got a few automated crash reports with this stack trace, with
getHostAddress()
called in aServiceListener.serviceResolved()
callback:looking at
getHostAddresses()
:line 420 is:
The only possible thing
null
on that line isip6Aaddresses[i]
.So I suppose
getInet6Addresses()
can return anInet6Address[]
where some elements arenull
.I have not checked if v3.5.8 would fix this issue but I doubt it.
Anyway, since my program does not make use of ipv6 at all, I worked-around this issue issue calling
ServiceInfoImpl.getInet4Address().getHostAddress()
.Still it would be nice to get the bottom line of that NPE.
The text was updated successfully, but these errors were encountered: