Skip to content

Commit 924a831

Browse files
committed
Fix is_bad_array for empty arrays
1 parent 02a8d26 commit 924a831

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ end
7575

7676
# Fastest way to check for NaN in an array.
7777
# (due to optimizations in sum())
78-
is_bad_array(array) = !isfinite(sum(array))
78+
is_bad_array(array) = !(isempty(array) || isfinite(sum(array)))
7979
isgood(x::T) where {T<:Number} = !(isnan(x) || !isfinite(x))
8080
isgood(x) = true
8181
isbad(x) = !isgood(x)

0 commit comments

Comments
 (0)