diff --git a/lib/libimhex/source/api/imhex_api.cpp b/lib/libimhex/source/api/imhex_api.cpp index 49a180c10..756a12fae 100644 --- a/lib/libimhex/source/api/imhex_api.cpp +++ b/lib/libimhex/source/api/imhex_api.cpp @@ -638,7 +638,8 @@ namespace hex { #elif defined(OS_MACOS) return ::getBackingScaleFactor(); #elif defined(OS_LINUX) - if (std::string_view(::getenv("XDG_SESSION_TYPE")) == "x11") + const auto sessionType = ::getenv("XDG_SESSION_TYPE"); + if (sessionType == nullptr || std::string_view(sessionType) == "x11") return 1.0F; else { float xScale = 0, yScale = 0;