mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
check nil
This commit is contained in:
parent
99a91f1444
commit
4a6fb63c8b
|
@ -59,6 +59,13 @@ func filterPlaintextMessages(args []interface{}) (texts []string, pureArgs []int
|
||||||
rt := reflect.TypeOf(arg)
|
rt := reflect.TypeOf(arg)
|
||||||
if rt.Kind() == reflect.Ptr {
|
if rt.Kind() == reflect.Ptr {
|
||||||
switch a := arg.(type) {
|
switch a := arg.(type) {
|
||||||
|
|
||||||
|
case nil:
|
||||||
|
texts = append(texts, "nil")
|
||||||
|
if firstObjectOffset == -1 {
|
||||||
|
firstObjectOffset = idx
|
||||||
|
}
|
||||||
|
|
||||||
case types.PlainText:
|
case types.PlainText:
|
||||||
texts = append(texts, a.PlainText())
|
texts = append(texts, a.PlainText())
|
||||||
if firstObjectOffset == -1 {
|
if firstObjectOffset == -1 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user