aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-02-22 12:27:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-02-22 12:27:59 +0300
commit2cec5d9c34dd880c732253c2129ce99524d01a1b (patch)
tree2e83656069ab2b38f621be5eeb193de3258a849a
parent4f2570d9090faad69b1dcfd54872a6973edb5ebd (diff)
Fix diag_stream_lock destructor that may try to dereference diag_term set to nullopt
-rw-r--r--libbutl/diagnostics.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/libbutl/diagnostics.cxx b/libbutl/diagnostics.cxx
index 0736f77..83e09e3 100644
--- a/libbutl/diagnostics.cxx
+++ b/libbutl/diagnostics.cxx
@@ -134,7 +134,10 @@ namespace butl
// same-line progress style, then reprint the current progress string
// that was overwritten with the diagnostics.
//
- if (diag_stream == &cerr && *diag_term && !diag_progress.empty ())
+ if (diag_stream == &cerr &&
+ !diag_progress.empty () &&
+ diag_term &&
+ *diag_term)
progress_print (diag_progress);
diag_mutex.unlock ();