From aa522731a2200263081c813712688ffd62dff0ca Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 20 Jun 2019 01:15:14 +0200 Subject: [PATCH] fix: building with enable_run_as_node disabled (#18887) --- atom/common/crash_reporter/crash_reporter.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/atom/common/crash_reporter/crash_reporter.cc b/atom/common/crash_reporter/crash_reporter.cc index 234bb300a004..93d8df1930c2 100644 --- a/atom/common/crash_reporter/crash_reporter.cc +++ b/atom/common/crash_reporter/crash_reporter.cc @@ -25,8 +25,13 @@ const char kCrashpadProcess[] = "crash-handler"; const char kCrashesDirectoryKey[] = "crashes-directory"; CrashReporter::CrashReporter() { - std::unique_ptr env = base::Environment::Create(); - if (env->HasVar(atom::kRunAsNode)) { +#if BUILDFLAG(ENABLE_RUN_AS_NODE) + bool run_as_node = base::Environment::Create()->HasVar(atom::kRunAsNode); +#else + bool run_as_node = false; +#endif + + if (run_as_node) { process_type_ = "node"; } else { auto* cmd = base::CommandLine::ForCurrentProcess();