From 4bd617187bbde59e8b796723969c90f63f78d20f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 24 Aug 2021 11:15:16 +0300 Subject: [PATCH] - fixed crash on getting location description without a level Run `bench` CCMD in fullscreen console, i.e. with no level loaded, wait five seconds, open menu https://forum.zdoom.org/viewtopic.php?t=73109&start=15#p1198234 --- src/d_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 6089e90b6a..842b1e9f42 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2849,7 +2849,7 @@ FString System_GetLocationDescription() { auto& vp = r_viewpoint; auto Level = vp.ViewLevel; - return FStringf("Map %s: \"%s\",\nx = %1.4f, y = %1.4f, z = %1.4f, angle = %1.4f, pitch = %1.4f\n%llu fps\n\n", + return Level == nullptr ? FString() : FStringf("Map %s: \"%s\",\nx = %1.4f, y = %1.4f, z = %1.4f, angle = %1.4f, pitch = %1.4f\n%llu fps\n\n", Level->MapName.GetChars(), Level->LevelName.GetChars(), vp.Pos.X, vp.Pos.Y, vp.Pos.Z, vp.Angles.Yaw.Degrees, vp.Angles.Pitch.Degrees, (unsigned long long)LastCount); }