diff --git a/handler/linux/crash_report_exception_handler.cc b/handler/linux/crash_report_exception_handler.cc index 4d37582b..84f9534f 100644 --- a/handler/linux/crash_report_exception_handler.cc +++ b/handler/linux/crash_report_exception_handler.cc @@ -184,13 +184,9 @@ bool CrashReportExceptionHandler::HandleExceptionWithConnection( UUID client_id; Settings* const settings = database_->GetSettings(); - if (settings) { - // If GetSettings() or GetClientID() fails, something else will log a - // message and client_id will be left at its default value, all zeroes, - // which is appropriate. - settings->GetClientID(&client_id); + if (settings && settings->GetClientID(&client_id)) { + process_snapshot->SetClientID(client_id); } - process_snapshot->SetClientID(client_id); return write_minidump_to_database_ ? WriteMinidumpToDatabase(process_snapshot.get(), diff --git a/handler/mac/crash_report_exception_handler.cc b/handler/mac/crash_report_exception_handler.cc index cccf1e94..ad3bac14 100644 --- a/handler/mac/crash_report_exception_handler.cc +++ b/handler/mac/crash_report_exception_handler.cc @@ -147,14 +147,9 @@ kern_return_t CrashReportExceptionHandler::CatchMachException( UUID client_id; Settings* const settings = database_->GetSettings(); - if (settings) { - // If GetSettings() or GetClientID() fails, something else will log a - // message and client_id will be left at its default value, all zeroes, - // which is appropriate. - settings->GetClientID(&client_id); + if (settings && settings->GetClientID(&client_id)) { + process_snapshot.SetClientID(client_id); } - - process_snapshot.SetClientID(client_id); process_snapshot.SetAnnotationsSimpleMap(*process_annotations_); std::unique_ptr new_report; diff --git a/handler/win/crash_report_exception_handler.cc b/handler/win/crash_report_exception_handler.cc index d78d9e6e..2098a574 100644 --- a/handler/win/crash_report_exception_handler.cc +++ b/handler/win/crash_report_exception_handler.cc @@ -82,14 +82,10 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException( if (client_options.crashpad_handler_behavior != TriState::kDisabled) { UUID client_id; Settings* const settings = database_->GetSettings(); - if (settings) { - // If GetSettings() or GetClientID() fails, something else will log a - // message and client_id will be left at its default value, all zeroes, - // which is appropriate. - settings->GetClientID(&client_id); + if (settings && settings->GetClientID(&client_id)) { + process_snapshot.SetClientID(client_id); } - process_snapshot.SetClientID(client_id); process_snapshot.SetAnnotationsSimpleMap(*process_annotations_); std::unique_ptr new_report; diff --git a/snapshot/fuchsia/process_snapshot_fuchsia.cc b/snapshot/fuchsia/process_snapshot_fuchsia.cc index d36335c5..8ebdae5c 100644 --- a/snapshot/fuchsia/process_snapshot_fuchsia.cc +++ b/snapshot/fuchsia/process_snapshot_fuchsia.cc @@ -36,6 +36,7 @@ bool ProcessSnapshotFuchsia::Initialize(const zx::process& process) { return false; } + client_id_.InitializeToZero(); system_.Initialize(&snapshot_time_); InitializeThreads(); diff --git a/snapshot/linux/process_snapshot_linux.cc b/snapshot/linux/process_snapshot_linux.cc index 53499b36..62331347 100644 --- a/snapshot/linux/process_snapshot_linux.cc +++ b/snapshot/linux/process_snapshot_linux.cc @@ -39,6 +39,7 @@ bool ProcessSnapshotLinux::Initialize(PtraceConnection* connection) { return false; } + client_id_.InitializeToZero(); system_.Initialize(&process_reader_, &snapshot_time_); GetCrashpadOptionsInternal((&options_)); diff --git a/snapshot/mac/process_snapshot_mac.cc b/snapshot/mac/process_snapshot_mac.cc index 528e9213..2a0884b9 100644 --- a/snapshot/mac/process_snapshot_mac.cc +++ b/snapshot/mac/process_snapshot_mac.cc @@ -50,6 +50,7 @@ bool ProcessSnapshotMac::Initialize(task_t task) { return false; } + client_id_.InitializeToZero(); system_.Initialize(&process_reader_, &snapshot_time_); InitializeThreads(); diff --git a/snapshot/win/process_snapshot_win.cc b/snapshot/win/process_snapshot_win.cc index 21df191a..b60ea38e 100644 --- a/snapshot/win/process_snapshot_win.cc +++ b/snapshot/win/process_snapshot_win.cc @@ -81,7 +81,7 @@ bool ProcessSnapshotWin::Initialize( } } - + client_id_.InitializeToZero(); system_.Initialize(&process_reader_); if (process_reader_.Is64Bit()) {