Skip to content

Commit 7b41a76

Browse files
committed
add additional checks for other primitive types
1 parent 2dd87f4 commit 7b41a76

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

values.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,30 @@ func isNullish(value interface{}) bool {
329329
if value, ok := value.(int); ok {
330330
return math.IsNaN(float64(value))
331331
}
332+
if value, ok := value.(*int); ok {
333+
if value == nil {
334+
return true
335+
}
336+
return math.IsNaN(float64(*value))
337+
}
332338
if value, ok := value.(float32); ok {
333339
return math.IsNaN(float64(value))
334340
}
341+
if value, ok := value.(*float32); ok {
342+
if value == nil {
343+
return true
344+
}
345+
return math.IsNaN(float64(*value))
346+
}
335347
if value, ok := value.(float64); ok {
336348
return math.IsNaN(value)
337349
}
350+
if value, ok := value.(*float64); ok {
351+
if value == nil {
352+
return true
353+
}
354+
return math.IsNaN(*value)
355+
}
338356
return value == nil
339357
}
340358

0 commit comments

Comments
 (0)