Merge branch '4580_mcedit_segfault'

* 4580_mcedit_segfault:
  Ticket #4580: mceditor: segfault on new file creation.
This commit is contained in:
Andrew Borodin 2024-08-29 21:52:45 +03:00
commit 242c413d80
1 changed files with 4 additions and 1 deletions

View File

@ -2164,7 +2164,10 @@ edit_init (WEdit *edit, const WRect *r, const edit_arg_t *arg)
edit->stat1.st_gid = getgid ();
edit->stat1.st_mtime = 0;
edit->attrs_ok = (mc_fgetflags (arg->file_vpath, &edit->attrs) == 0);
if (arg != NULL)
edit->attrs_ok = (mc_fgetflags (arg->file_vpath, &edit->attrs) == 0);
else
edit->attrs_ok = FALSE;
edit->over_col = 0;
edit->bracket = -1;