aboutsummaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/buffer.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/buffer.go b/editor/buffer.go
index 9b7444a..702528c 100644
--- a/editor/buffer.go
+++ b/editor/buffer.go
@@ -253,7 +253,9 @@ func (b *Buffer) Destroy() {
b.buf.Destroy()
b.SetDot(0, 0)
b.dirty = false
- b.file.read = false
+ if b.file != nil {
+ b.file.read = false
+ }
}
// Len returns the number of bytes in buffer.