From 54952cef26563d376e4a273e05973a0038e811bc Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Sun, 10 Jul 2022 12:23:11 -0400 Subject: [PATCH] Fixed a bug that referenced uninitialized operator.snapshotCache --- src/duplicacy_chunkoperator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/duplicacy_chunkoperator.go b/src/duplicacy_chunkoperator.go index 6c71f42..4e1671a 100644 --- a/src/duplicacy_chunkoperator.go +++ b/src/duplicacy_chunkoperator.go @@ -489,7 +489,7 @@ func (operator *ChunkOperator) UploadChunk(threadIndex int, task ChunkTask) bool chunk.VerifyID() } - if task.isMetadata && operator.storage.IsCacheNeeded() { + if task.isMetadata && operator.snapshotCache != nil && operator.storage.IsCacheNeeded() { // Save a copy to the local snapshot. chunkPath, exist, _, err := operator.snapshotCache.FindChunk(threadIndex, chunkID, false) if err != nil {