Skip to content

Commit 5148285

Browse files
Alex MellnikAlex Mellnik
authored andcommitted
Handle NullableArrays with missing, undefined vals
Don't attempt to access the value without first making sure the value is not null.
1 parent a227bc4 commit 5148285

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Sink.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ end
3434
# create a new SQLite table
3535
# Data.Table
3636
function getbind!{T}(dt::NullableVector{T},row,col,stmt)
37-
@inbounds val, isnull = dt.values[row]::T, dt.isnull[row]
37+
@inbounds isnull = dt.isnull[row]
3838
if isnull
3939
SQLite.bind!(stmt,col,NULL)
4040
else
41+
@inbounds val = dt.values[row]::T
4142
SQLite.bind!(stmt,col,val)
4243
end
4344
return

0 commit comments

Comments
 (0)