diff --git a/input/encoder.go b/input/encoder.go index f0373a6..9b4780f 100644 --- a/input/encoder.go +++ b/input/encoder.go @@ -15,7 +15,6 @@ // limitations under the License. // - package input import ( diff --git a/output/decoder.go b/output/decoder.go index faf9595..0242990 100644 --- a/output/decoder.go +++ b/output/decoder.go @@ -85,7 +85,10 @@ func GetRecord(dec *FLBDecoder) (ret int, ts interface{}, rec map[interface{}]in t := slice.Index(0).Interface() data := slice.Index(1) - map_data := data.Interface().(map[interface{}]interface{}) + map_data, ok := data.Interface().(map[interface{}]interface{}) + if !ok { + return -3, 0, nil + } return 0, t, map_data }