mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-12 16:26:37 +00:00
lib/model: Remove incorrect/useless panics (#5881)
This commit is contained in:
parent
7b3d9a8dca
commit
6f08162376
@ -68,7 +68,7 @@ func (f *sendOnlyFolder) pull() bool {
|
|||||||
curFile, ok := f.fset.Get(protocol.LocalDeviceID, intf.FileName())
|
curFile, ok := f.fset.Get(protocol.LocalDeviceID, intf.FileName())
|
||||||
if !ok {
|
if !ok {
|
||||||
if intf.IsDeleted() {
|
if intf.IsDeleted() {
|
||||||
panic("Should never get a deleted file as needed when we don't have it")
|
l.Debugln("Should never get a deleted file as needed when we don't have it")
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -248,10 +248,8 @@ func (m *model) StartFolder(folder string) {
|
|||||||
|
|
||||||
// Need to hold lock on m.fmut when calling this.
|
// Need to hold lock on m.fmut when calling this.
|
||||||
func (m *model) startFolderLocked(cfg config.FolderConfiguration) {
|
func (m *model) startFolderLocked(cfg config.FolderConfiguration) {
|
||||||
if err := m.checkFolderRunningLocked(cfg.ID); err == errFolderMissing {
|
_, ok := m.folderRunners[cfg.ID]
|
||||||
l.Warnln("Cannot start nonexistent folder", cfg.Description())
|
if ok {
|
||||||
panic("cannot start nonexistent folder")
|
|
||||||
} else if err == nil {
|
|
||||||
l.Warnln("Cannot start already running folder", cfg.Description())
|
l.Warnln("Cannot start already running folder", cfg.Description())
|
||||||
panic("cannot start already running folder")
|
panic("cannot start already running folder")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user