From edffd4af81955ebcbf9d5600cf8aa3c60cc97122 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 29 Dec 2025 17:14:32 +0100 Subject: [PATCH] Check for content being available when deleting user message. --- profiler/src/profiler/TracyLlm.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index ed9baa90..f1aec8ce 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -456,10 +456,14 @@ void TracyLlm::Draw() } else if( role == TracyLlmChat::TurnRole::User || role == TracyLlmChat::TurnRole::UserDebug ) { - const auto sz = std::min( InputBufferSize - 1, content.size() ); - memcpy( m_input, content.data(), sz ); - m_input[sz] = 0; - inputChanged = true; + if( line.contains( "content" ) ) + { + auto& content = line["content"].get_ref(); + const auto sz = std::min( InputBufferSize - 1, content.size() ); + memcpy( m_input, content.data(), sz ); + m_input[sz] = 0; + inputChanged = true; + } } auto cit = it;