You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ja...@apache.org on 2020/11/26 16:23:08 UTC

[incubator-brpc] branch master updated: add a null check in ~LogPostfixDummy

This is an automated email from the ASF dual-hosted git repository.

jamesge pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new c1dd203  add a null check in ~LogPostfixDummy
c1dd203 is described below

commit c1dd203534dd9268edbc264e27b412ea718a790a
Author: jamesge <jg...@gmail.com>
AuthorDate: Fri Nov 27 00:22:14 2020 +0800

    add a null check in ~LogPostfixDummy
---
 src/brpc/controller.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/brpc/controller.cpp b/src/brpc/controller.cpp
index 0ef6004..f343edb 100644
--- a/src/brpc/controller.cpp
+++ b/src/brpc/controller.cpp
@@ -1541,7 +1541,9 @@ void Controller::FlushSessionKV(std::ostream& os) {
 }
 
 Controller::LogPostfixDummy::~LogPostfixDummy() {
-    *osptr << postfix;
+    if (osptr != nullptr) {
+        *osptr << postfix;
+    }
 }
 
 std::ostream& operator<<(std::ostream& os, const Controller::LogPostfixDummy& p) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org