소스 검색

fix(model): don't panic in index consistency print (fixes #9821) (#9823)

We try to compare to the last fileinfo, but apparently we can end up
here with an empty file list and crash on out of index.
Jakob Borg 11 달 전
부모
커밋
110e1ae6f9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/model/indexhandler.go

+ 1 - 1
lib/model/indexhandler.go

@@ -448,7 +448,7 @@ func (s *indexHandler) receive(fs []protocol.FileInfo, update bool, op string, p
 	seq := fset.Sequence(deviceID)
 
 	// Check that the sequence we get back is what we put in...
-	if lastSequence > 0 && seq != lastSequence {
+	if lastSequence > 0 && len(fs) > 0 && seq != lastSequence {
 		s.logSequenceAnomaly("unexpected sequence after update", map[string]any{
 			"prevSeq":     prevSequence,
 			"lastSeq":     lastSequence,