Fix issues

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2025-08-30 02:03:02 +01:00
parent 8025cfad8d
commit 1ff964a14a

View File

@@ -458,17 +458,15 @@ public:
Journal(
Journal const& other,
std::optional<JsonLogAttributes> 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. */