mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
fix panic divide by zero
This commit is contained in:
+3
-3
@@ -124,9 +124,9 @@ func (g *Generator) genTypeDecoderNoCheck(t reflect.Type, out string, tags field
|
||||
|
||||
} else {
|
||||
|
||||
capacity := minSliceBytes / elem.Size()
|
||||
if capacity == 0 {
|
||||
capacity = 1
|
||||
capacity := 1
|
||||
if elem.Size() > 0 {
|
||||
capacity = minSliceBytes / int(elem.Size())
|
||||
}
|
||||
|
||||
fmt.Fprintln(g.out, ws+"if in.IsNull() {")
|
||||
|
||||
Reference in New Issue
Block a user