From a31ab53d26fa9ee684e7f9cee8bc4862f1665195 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 5 Feb 2026 18:31:05 +0100 Subject: [PATCH] Check if the response contains finish_reason before getting its value. --- profiler/src/profiler/TracyLlm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index 0933a2fa..f407f7c3 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -1050,7 +1050,7 @@ bool TracyLlm::OnResponse( const nlohmann::json& json ) AppendResponse( "reasoning_content", delta ); AppendResponse( "tool_calls", delta ); - done = !node["finish_reason"].empty(); + done = node.contains( "finish_reason" ) && !node["finish_reason"].empty(); } } else if( json.contains( "error" ) )