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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to