{"record":{"id":"54636be418fd5e86","repo":"chenhg5/cc-connect","slug":"empty-url-54636b","errorCode":null,"errorMessage":"empty URL","messagePattern":"empty URL","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/tuitui/tuitui.go","lineNumber":848,"sourceCode":"\t\t\tfiles = append(files, core.FileAttachment{MimeType: mimeType, Data: buf, FileName: name})\n\t\t}\n\t}\n\n\tvar audio *core.AudioAttachment\n\tif data.Voice != \"\" {\n\t\tbuf, mimeType, name, err := p.downloadAttachment(ctx, data.Voice)\n\t\tif err != nil {\n\t\t\tslog.Warn(\"tuitui: voice download failed\", \"error\", err)\n\t\t} else {\n\t\t\taudio = &core.AudioAttachment{MimeType: mimeType, Data: buf, Format: extFormat(name)}\n\t\t}\n\t}\n\treturn images, files, audio\n}\n\nfunc (p *Platform) downloadAttachment(ctx context.Context, rawURL string) ([]byte, string, string, error) {\n\tif rawURL == \"\" {\n\t\treturn nil, \"\", \"\", fmt.Errorf(\"empty URL\")\n\t}\n\tdctx, cancel := context.WithTimeout(ctx, attachmentDownloadTO)\n\tdefer cancel()\n\treq, err := http.NewRequestWithContext(dctx, http.MethodGet, rawURL, nil)\n\tif err != nil {\n\t\treturn nil, \"\", \"\", err\n\t}\n\tresp, err := p.client.Do(req)\n\tif err != nil {\n\t\treturn nil, \"\", \"\", errorsRedacted(err, p.appSecret)\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\tif resp.StatusCode < 200 || resp.StatusCode >= 300 {\n\t\treturn nil, \"\", \"\", fmt.Errorf(\"HTTP %d\", resp.StatusCode)\n\t}\n\tif resp.ContentLength > maxAttachmentBytes {\n\t\treturn nil, \"\", \"\", fmt.Errorf(\"attachment too large: %d\", resp.ContentLength)\n\t}","sourceCodeStart":830,"sourceCodeEnd":866,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/tuitui/tuitui.go#L830-L866","documentation":"Validation guard in the tuitui platform's downloadAttachment helper: the raw attachment URL argument is empty, so the voice/file/image download cannot proceed; callers log a warning and skip the attachment.","triggerScenarios":"Thrown at platform/tuitui/tuitui.go:848 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the inbound event actually carries an attachment URL","Skip attachment processing when absent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}