mirror of
https://github.com/fullstorydev/grpcurl.git
synced 2026-05-22 19:51:44 +03:00
fix crash when emitting empty messages in text format (#153)
This commit is contained in:
@@ -179,7 +179,7 @@ func (tf *textFormatter) format(m proto.Message) (string, error) {
|
|||||||
|
|
||||||
// no trailing newline needed
|
// no trailing newline needed
|
||||||
str := buf.String()
|
str := buf.String()
|
||||||
if str[len(str)-1] == '\n' {
|
if len(str) > 0 && str[len(str)-1] == '\n' {
|
||||||
str = str[:len(str)-1]
|
str = str[:len(str)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user