mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-08 19:38:51 +01:00
allow nil for display
This commit is contained in:
parent
8e4b02cec4
commit
3936db0429
@ -589,6 +589,9 @@ type PacketType interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AsString(pk PacketType) string {
|
func AsString(pk PacketType) string {
|
||||||
|
if pk == nil {
|
||||||
|
return "nil"
|
||||||
|
}
|
||||||
if s, ok := pk.(fmt.Stringer); ok {
|
if s, ok := pk.(fmt.Stringer); ok {
|
||||||
return s.String()
|
return s.String()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user