diff --git a/tools/Forge/Bundles/MapEdit/Map.m b/tools/Forge/Bundles/MapEdit/Map.m index f41a71545..46ad7341e 100644 --- a/tools/Forge/Bundles/MapEdit/Map.m +++ b/tools/Forge/Bundles/MapEdit/Map.m @@ -239,6 +239,8 @@ readMapFile Sys_Printf ("loading %s\n", fname); file = Qopen (fname, "rt"); + if (!file) + return self; size = Qfilesize (file); dat = malloc (size + 1); size = Qread (file, dat, size); diff --git a/tools/Forge/Bundles/MapEdit/QuakeEd.m b/tools/Forge/Bundles/MapEdit/QuakeEd.m index d457eeb92..65be3b8c1 100644 --- a/tools/Forge/Bundles/MapEdit/QuakeEd.m +++ b/tools/Forge/Bundles/MapEdit/QuakeEd.m @@ -67,6 +67,8 @@ DisplayCmdOutput (void) int size; file = Qopen (FN_CMDOUT, "rt"); + if (!file) + return; size = Qfilesize (file); buffer = malloc (size + 1); size = Qread (file, buffer, size);