From ce0456b5acde4dcef59e81cc7b1b53bf203cf3e0 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 12 Apr 2017 11:28:12 +0200 Subject: [PATCH] lib/protocol: Accept invalid files without blocks (fixes #4093) --- lib/protocol/protocol.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/protocol/protocol.go b/lib/protocol/protocol.go index da089baa3..f12a742ba 100644 --- a/lib/protocol/protocol.go +++ b/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