mirror of https://github.com/zlatinb/muwire
avoid npe for first time failed incoming attempts
parent
dce69bbbbe
commit
aeb392eba9
|
@ -55,13 +55,13 @@ class H2HostCache extends HostCache {
|
||||||
protected synchronized void onConnection(Destination d, ConnectionAttemptStatus status) {
|
protected synchronized void onConnection(Destination d, ConnectionAttemptStatus status) {
|
||||||
|
|
||||||
log.fine("onConnection ${d.toBase32()} status $status")
|
log.fine("onConnection ${d.toBase32()} status $status")
|
||||||
if (status == ConnectionAttemptStatus.SUCCESSFUL) {
|
if (uniqueHosts.add(d)) {
|
||||||
if (uniqueHosts.add(d)) {
|
allHosts.add(d)
|
||||||
allHosts.add(d)
|
profiles.put(d, new HostMCProfile())
|
||||||
profiles.put(d, new HostMCProfile())
|
|
||||||
}
|
|
||||||
profiles.get(d).successfulAttempt = true
|
|
||||||
}
|
}
|
||||||
|
if (status == ConnectionAttemptStatus.SUCCESSFUL)
|
||||||
|
profiles.get(d).successfulAttempt = true
|
||||||
|
|
||||||
int historyItems = profiles.get(d).hasHistory ? settings.hostProfileHistory : 1
|
int historyItems = profiles.get(d).hasHistory ? settings.hostProfileHistory : 1
|
||||||
|
|
||||||
// record into db
|
// record into db
|
||||||
|
|
Loading…
Reference in New Issue