Check nil in RawJSON. (#45)
This commit is contained in:
parent
be4b7c1474
commit
5250a1ba2d
3
event.go
3
event.go
|
@ -233,6 +233,9 @@ func (e *Event) Hex(key string, val []byte) *Event {
|
|||
// No sanity check is performed on b; it must not contain carriage returns and
|
||||
// be valid JSON.
|
||||
func (e *Event) RawJSON(key string, b []byte) *Event {
|
||||
if e == nil {
|
||||
return e
|
||||
}
|
||||
e.buf = append(json.AppendKey(e.buf, key), b...)
|
||||
return e
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue