diff options
author | Jakob Borg <jakob@nym.se> | 2014-08-31 13:48:16 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-08-31 13:48:16 +0200 |
commit | 75b26513e10f3fa768e3de135eba2798cb26fbc8 (patch) | |
tree | 53b77ec734c6ec3f8c796adec32ad05ec415517e | |
parent | 6c09a77a978e61570f3dd2df9f1d43ea06cf7fd8 (diff) |
Don't crash under suspicious circumstances... (fixes #602)
-rw-r--r-- | model/model.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/model/model.go b/model/model.go index b4f947280c..fc247d2cfd 100644 --- a/model/model.go +++ b/model/model.go @@ -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() } |