From 5656be5206623c068c7faeee214a6d03b7e239f3 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 12 Oct 2014 10:36:04 +0200 Subject: [PATCH] Folders queried by the REST interface might not exist in the model (fixes #823) --- internal/model/model.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/model/model.go b/internal/model/model.go index f976abf6..546150b7 100644 --- a/internal/model/model.go +++ b/internal/model/model.go @@ -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)