Skip to content

Commit 036dea7

Browse files
committed
add double guard for closing the writer.
1 parent 4d9b206 commit 036dea7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/DotJEM.Json.Index2/IO/JsonIndexWriterManager.cs

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public void Close()
4848

4949
lock (padlock)
5050
{
51+
if (!writer.IsValueCreated)
52+
return;
53+
5154
writer.Value.Dispose();
5255
writer = new(() => Open(index));
5356
RaiseOnClose();

0 commit comments

Comments
 (0)