allow nil for display

This commit is contained in:
sawka 2022-08-31 12:45:59 -07:00
parent 8e4b02cec4
commit 3936db0429

View File

@ -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()
} }