From 68010d931a64b9e6309c0390d231a2895d0d9c9a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg <bensberg@justemail.net> Date: Tue, 16 Aug 2016 16:56:25 +0200 Subject: [PATCH] startup: don't crash when dying early That is: don't try to look at open files when none are open yet. --- src/nano.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nano.c b/src/nano.c index 356a1de3..93598607 100644 --- a/src/nano.c +++ b/src/nano.c @@ -605,7 +605,7 @@ void die(const char *msg, ...) #ifndef NANO_TINY /* If the current buffer has a lockfile, remove it. */ - if (ISSET(LOCKING) && openfile->lock_filename) + if (openfile && ISSET(LOCKING) && openfile->lock_filename) delete_lockfile(openfile->lock_filename); #endif -- GitLab