flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.13k stars 262 forks source link

Assertion failure when parsing config with empty lines #1304

Closed Lassebq closed 2 months ago

Lassebq commented 2 months ago

Describe the bug Assertion failure when parsing config

List relevant hardware/software information

To Reproduce

Create a config with empty lines in .config/MangoHud/MangoHud.conf

$ mangohud glxgears                
/usr/include/c++/13.2.1/bits/basic_string.h:1317: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::front() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]: Assertion '!empty()' failed.
zsh: abort      mangohud glxgears

Expected behavior Empty lines in the config won't crash mangohud

Additional context Possible solution: https://stackoverflow.com/a/78011282