From 3cb3966f815792abff79b9fa80fe324e8948a71b Mon Sep 17 00:00:00 2001 From: JCW Date: Sat, 30 Aug 2025 02:03:02 +0100 Subject: [PATCH] Fix issues Signed-off-by: JCW --- include/xrpl/beast/utility/Journal.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/xrpl/beast/utility/Journal.h b/include/xrpl/beast/utility/Journal.h index d501ae29f6..89a046892b 100644 --- a/include/xrpl/beast/utility/Journal.h +++ b/include/xrpl/beast/utility/Journal.h @@ -458,17 +458,15 @@ public: Journal( Journal const& other, std::optional attributes = std::nullopt) - : m_sink(other.m_sink) + : m_attributes(other.m_attributes) + , m_sink(other.m_sink) { if (attributes.has_value()) - m_attributes = std::move(attributes.value()); - if (other.m_attributes.has_value()) { - if (m_attributes.has_value()) - m_attributes->combine( - other.m_attributes->contextValues_); + if (m_attributes) + m_attributes->combine(attributes->contextValues_); else - m_attributes = other.m_attributes; + m_attributes = std::move(attributes); } } /** Create a journal that writes to the specified sink. */