Folders queried by the REST interface might not exist in the model (fixes #823)

This commit is contained in:
Jakob Borg 2014-10-12 10:36:04 +02:00
parent 484ce8e488
commit 5656be5206

View File

@ -1216,7 +1216,9 @@ func (m *Model) CurrentLocalVersion(folder string) uint64 {
fs, ok := m.folderFiles[folder]
if !ok {
panic("bug: LocalVersion called for nonexistent folder " + folder)
// The folder might not exist, since this can be called with a user
// specified folder name from the REST interface.
return 0
}
return fs.LocalVersion(protocol.LocalDeviceID)