diff --git a/buffer.c b/buffer.c index f67dd26..3b2352a 100644 --- a/buffer.c +++ b/buffer.c @@ -761,8 +761,10 @@ readBufferCache(Buffer *buf) } #endif } - buf->lastLine = prevl; - buf->lastLine->next = NULL; + if (prevl) { + buf->lastLine = prevl; + buf->lastLine->next = NULL; + } fclose(cache); unlink(buf->savecache); buf->savecache = NULL;