-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: Return nullopt when process_context is nullptr (#14181)
The InstanceImpl::processContext() function returns a ProcessContextOptRef a.k.a. absl::optional<std::reference_wrapper<ProcessContext>>. When InstanceImpl::process_context_ is nullptr, the returned value an absl::optional with a value of std::reference_wrapper<>(nullptr), better known as an illegal reference to nullptr. While everything is fine in the InstanceImpl, anyone who tries to use the returned reference will be greeted with a crash. This commit follows the lead of the initializer of InstanceImpl::api_ and returns absl::nullopt when InstanceImpl::process_context_ is nullptr. Risk: Low Testing: bazel test //test/server:server_test Documentation: N/A Release Notes: N/A Signed-off-by: Justin Mazzola Paluska <[email protected]>
- Loading branch information
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters