Browse Source

lib/protocol: Accept invalid files without blocks (fixes #4093)

Jakob Borg 8 years ago
parent
commit
e3e028c988
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/protocol/protocol.go

+ 2 - 2
lib/protocol/protocol.go

@@ -495,8 +495,8 @@ func checkFileInfoConsistency(f FileInfo) error {
 		// Directories should have no blocks
 		return errDirectoryHasBlocks
 
-	case !f.Deleted && f.Type == FileInfoTypeFile && len(f.Blocks) == 0:
-		// Non-deleted files should have at least one block
+	case !f.Deleted && !f.Invalid && f.Type == FileInfoTypeFile && len(f.Blocks) == 0:
+		// Non-deleted, non-invalid files should have at least one block
 		return errFileHasNoBlocks
 	}
 	return nil