diff --git a/src/nano.c b/src/nano.c
index 8350d29fb720c6e37ea677bfeec367832172938d..955ec4ca6615dd04c33f96473b12745d3fe0dac4 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -617,8 +617,9 @@ void die(const char *msg, ...)
 		}
 
 		filepart = NULL;
+#ifdef ENABLE_MULTIBUFFER
 		openfile = openfile->next;
-
+#endif
 		if (openfile == firstone)
 			break;
 	}