fix: Properly check if distro info exists before printing it
This commit is contained in:
parent
9cf3250751
commit
26af5987a5
@ -52,8 +52,9 @@ int main(int argc, char **argv) {
|
|||||||
log::info("Running on {} {} ({})", ImHexApi::System::getOSName(), ImHexApi::System::getOSVersion(), ImHexApi::System::getArchitecture());
|
log::info("Running on {} {} ({})", ImHexApi::System::getOSName(), ImHexApi::System::getOSVersion(), ImHexApi::System::getArchitecture());
|
||||||
|
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
auto distro = ImHexApi::System::getLinuxDistro().value();
|
if (auto distro = ImHexApi::System::getLinuxDistro(); distro.has_value()) {
|
||||||
log::info("Linux distribution: {}. Version: {}", distro.name, distro.version == "" ? "None" : distro.version);
|
log::info("Linux distribution: {}. Version: {}", distro->name, distro->version == "" ? "None" : distro->version);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user