From 0c0d479564066e49395d8edca951929082cc4e00 Mon Sep 17 00:00:00 2001 From: Echin-h <23050118@hdu.edu.cn> Date: Wed, 10 Dec 2025 14:47:24 +0800 Subject: [PATCH] fix: getFileStruct null pointer exception --- llm/tool/ast_read.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llm/tool/ast_read.go b/llm/tool/ast_read.go index bddc68d9..825d3881 100644 --- a/llm/tool/ast_read.go +++ b/llm/tool/ast_read.go @@ -398,7 +398,9 @@ func (t *ASTReadTools) GetFileStructure(_ context.Context, req GetFileStructReq) log.Debug("get file structure, req: %v", abutil.MarshalJSONIndentNoError(req)) resp, err := t.getFileStructure(context.Background(), req, true) if err != nil { - resp.Error = err.Error() + return &GetFileStructResp{ + Error: err.Error(), + }, nil } log.Debug("get repo structure, resp: %v", abutil.MarshalJSONIndentNoError(resp)) return resp, nil