From 2cec5d9c34dd880c732253c2129ce99524d01a1b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 22 Feb 2019 12:27:59 +0300 Subject: Fix diag_stream_lock destructor that may try to dereference diag_term set to nullopt --- libbutl/diagnostics.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 (); -- cgit v1.1