diff --git a/state/inverted_index.go b/state/inverted_index.go index 710fa49e2..88aa5d435 100644 --- a/state/inverted_index.go +++ b/state/inverted_index.go @@ -291,6 +291,9 @@ func (ii *InvertedIndex) FinishWrites() { } func (ii *InvertedIndex) Flush() error { + if ii.w == nil { + return nil + } if err := ii.w.flush(ii.tx); err != nil { return err }