hack/pin-dependency.sh github.com/go-openapi/validate v0.19.5
This commit is contained in:
6
vendor/github.com/go-openapi/runtime/text.go
generated
vendored
6
vendor/github.com/go-openapi/runtime/text.go
generated
vendored
@@ -39,6 +39,12 @@ func TextConsumer() Consumer {
|
||||
}
|
||||
b := buf.Bytes()
|
||||
|
||||
// If the buffer is empty, no need to unmarshal it, which causes a panic.
|
||||
if len(b) == 0 {
|
||||
data = ""
|
||||
return nil
|
||||
}
|
||||
|
||||
if tu, ok := data.(encoding.TextUnmarshaler); ok {
|
||||
err := tu.UnmarshalText(b)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user