check nil

This commit is contained in:
c9s 2022-06-13 12:03:31 +08:00
parent 99a91f1444
commit 4a6fb63c8b
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -59,6 +59,13 @@ func filterPlaintextMessages(args []interface{}) (texts []string, pureArgs []int
rt := reflect.TypeOf(arg)
if rt.Kind() == reflect.Ptr {
switch a := arg.(type) {
case nil:
texts = append(texts, "nil")
if firstObjectOffset == -1 {
firstObjectOffset = idx
}
case types.PlainText:
texts = append(texts, a.PlainText())
if firstObjectOffset == -1 {