diff options
-rw-r--r-- | desktop/source/app/crashreport.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 432be67cdcd3..3689613cb359 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -222,16 +222,17 @@ void CrashReporter::removeExceptionHandler() bool CrashReporter::IsDumpEnable() { - OUString sToken; - OString sEnvVar(std::getenv("CRASH_DUMP_ENABLE")); - bool bEnable = true; // default, always on + auto const env = std::getenv("CRASH_DUMP_ENABLE"); + if (env != nullptr && env[0] != '\0') { + return true; + } // read configuration item 'CrashDumpEnable' -> bool on/off - if (rtl::Bootstrap::get("CrashDumpEnable", sToken) && sEnvVar.isEmpty()) + OUString sToken; + if (rtl::Bootstrap::get("CrashDumpEnable", sToken)) { - bEnable = sToken.toBoolean(); + return sToken.toBoolean(); } - - return bEnable; + return true; // default, always on } |