Don't crash under suspicious circumstances... (fixes #602)

This commit is contained in:
Jakob Borg 2014-08-31 13:48:16 +02:00
parent 6c09a77a97
commit 75b26513e1

View File

@ -582,7 +582,11 @@ func (m *Model) AddConnection(rawConn io.Closer, protoConn protocol.Connection)
fs := m.repoFiles[repo]
go sendIndexes(protoConn, repo, fs)
}
m.nodeStatRefs[nodeID].WasSeen()
if statRef, ok := m.nodeStatRefs[nodeID]; ok {
statRef.WasSeen()
} else {
l.Warnf("AddConnection for unconfigured node %v?", nodeID)
}
m.rmut.RUnlock()
m.pmut.Unlock()
}