From 43df0ba7786df25ed1ba31f0245f408a8709cc14 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 20 Sep 2023 20:20:14 +0700 Subject: [PATCH] Host_Motd_f: Fixed viewing motd when motdfile is not specified --- rehlds/engine/host_cmd.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rehlds/engine/host_cmd.cpp b/rehlds/engine/host_cmd.cpp index d76815cb8..6761d9d63 100644 --- a/rehlds/engine/host_cmd.cpp +++ b/rehlds/engine/host_cmd.cpp @@ -210,6 +210,13 @@ void Host_Motd_f(void) Con_Printf("Unable to open %s (contains illegal characters)\n", pFileList); return; } + + if (Q_strlen(pFileList) <= 0) + { + Con_Printf("Unable to open MOTD (motdfile not specified)\n"); + return; + } + pFile = FS_Open(pFileList, "rb"); if (!pFile) {