diff --git a/src/tools/ecode/plugins/aiassistant/chatui.cpp b/src/tools/ecode/plugins/aiassistant/chatui.cpp index d95f3b32d..69f29d2dd 100644 --- a/src/tools/ecode/plugins/aiassistant/chatui.cpp +++ b/src/tools/ecode/plugins/aiassistant/chatui.cpp @@ -2365,6 +2365,8 @@ nlohmann::json LLMChatUI::chatToJson( bool forRequest ) { if ( !roleDDL || !editorNode || !editorNode->isType( UI_TYPE_CODEEDITOR ) ) continue; UICodeEditor* codeEditor = editorNode->asType(); + if ( codeEditor->getDocument().isEmpty() ) + continue; std::string role = LLMChat::roleToString( static_cast( roleDDL->getListBox()->getItemSelectedIndex() ) ); auto text = codeEditor->getDocument().toUtf8String();