diff --git a/src/files.c b/src/files.c
index 0b743578260535ba594aa1b052756e803e2ca150..22fe6ecca021dffa9b1d882c71aea000c76b2519 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1801,9 +1801,9 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
      * aren't appending, prepending, or writing a selection, we backup
      * only if the file has not been modified by someone else since nano
      * opened it. */
-    if (ISSET(BACKUP_FILE) && !tmp && realexists && ((append != OVERWRITE ||
-		openfile->mark_set) || (openfile->current_stat &&
-		openfile->current_stat->st_mtime == st.st_mtime))) {
+    if (ISSET(BACKUP_FILE) && !tmp && realexists && openfile->current_stat &&
+		(append != OVERWRITE || openfile->mark_set ||
+		openfile->current_stat->st_mtime == st.st_mtime)) {
 	int backup_fd;
 	FILE *backup_file;
 	char *backupname;