Skip to content

Commit 2acb6d0

Browse files
committed
Fix and test InexactError
1 parent 551f793 commit 2acb6d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/functions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,8 +1213,8 @@ function Base.convert(
12131213
::Type{VectorAffineFunction{T}},
12141214
f::VectorQuadraticFunction{T},
12151215
) where {T}
1216-
if any(!iszero(t.coef) for t in f.quadratic_terms)
1217-
throw(InexactError, :convert, VectorAffineFunction{T}, f)
1216+
if any(!iszero(t.scalar_term.coefficient) for t in f.quadratic_terms)
1217+
throw(InexactError(:convert, VectorAffineFunction{T}, f))
12181218
end
12191219
return VectorAffineFunction{T}(f.affine_terms, f.constants)
12201220
end

0 commit comments

Comments
 (0)