diff --git a/client/crashpad_client.h b/client/crashpad_client.h index dfe13538..207f9784 100644 --- a/client/crashpad_client.h +++ b/client/crashpad_client.h @@ -124,8 +124,8 @@ class CrashpadClient { //! `StartHandler()` must have successfully been called before calling this //! method. //! - //! \param[out] sock The socket connected to the handler. - //! \param[out] pid The handler's process ID. + //! \param[out] sock The socket connected to the handler, if not `nullptr`. + //! \param[out] pid The handler's process ID, if not `nullptr`. //! \return `true` on success. Otherwise `false` with a message logged. static bool GetHandlerSocket(int* sock, pid_t* pid); diff --git a/client/crashpad_client_linux.cc b/client/crashpad_client_linux.cc index f1368ec7..74f15403 100644 --- a/client/crashpad_client_linux.cc +++ b/client/crashpad_client_linux.cc @@ -295,8 +295,12 @@ class RequestCrashDumpHandler : public SignalHandler { if (!sock_to_handler_.is_valid()) { return false; } - *sock = sock_to_handler_.get(); - *pid = handler_pid_; + if (sock) { + *sock = sock_to_handler_.get(); + } + if (pid) { + *pid = handler_pid_; + } return true; }