Browse Source

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

Jakob Borg 11 years ago
parent
commit
5656be5206
1 changed files with 3 additions and 1 deletions
  1. 3 1
      internal/model/model.go

+ 3 - 1
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)