startup: do not crash when trying to open a device or directory

Make sure there is an 'openfile' record before trying to save an
error message in this record.

This fixes https://savannah.gnu.org/bugs/?60268.

Bug existed since commit ede64d7e from yesterday.
This commit is contained in:
Benno Schulenberg 2021-03-22 15:44:55 +01:00
parent 3d9e803aed
commit 6bf52dcc8d

View File

@ -2230,7 +2230,7 @@ void statusline(message_type importance, const char *msg, ...)
va_end(ap);
#ifdef ENABLE_MULTIBUFFER
if (!we_are_running && importance == ALERT &&
if (!we_are_running && importance == ALERT && openfile &&
!openfile->errormessage && openfile->next != openfile)
openfile->errormessage = copy_of(compound);
#endif