mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 18:41:59 -07:00
Don't crash on new nodes (fixes #656)
This commit is contained in:
parent
5537d53f9a
commit
1e51fca0b0
@ -565,10 +565,10 @@ func (cf cFiler) CurrentFile(file string) protocol.FileInfo {
|
||||
// ConnectedTo returns true if we are connected to the named node.
|
||||
func (m *Model) ConnectedTo(nodeID protocol.NodeID) bool {
|
||||
m.pmut.RLock()
|
||||
_, ok := m.protoConn[nodeID]
|
||||
if ok {
|
||||
m.nodeStatRefs[nodeID].WasSeen()
|
||||
if statRef, ok := m.nodeStatRefs[nodeID]; ok {
|
||||
statRef.WasSeen()
|
||||
}
|
||||
_, ok := m.protoConn[nodeID]
|
||||
m.pmut.RUnlock()
|
||||
return ok
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user