Skip to content

Commit

Permalink
fix: don't panic if record received by fluentbit is invalid
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Wöhrl <[email protected]>
  • Loading branch information
woehrl01 committed May 4, 2023
1 parent 92ef537 commit 736d195
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion input/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// limitations under the License.
//


package input

import (
Expand Down
5 changes: 4 additions & 1 deletion output/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 736d195

Please sign in to comment.