Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typeassert error in read_refs #170

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions src/JLD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,28 @@ function read_refs{T}(obj::JldDataset, ::Type{T}, dspace_id::HDF5.Hid, dsel_id::
refs = Array{HDF5ReferenceObj}(dims)
HDF5.h5d_read(obj.plain.id, HDF5.H5T_STD_REF_OBJ, dspace_id, dsel_id, HDF5.H5P_DEFAULT, refs)

out = Array{T}(dims)
f = file(obj)
for i = 1:length(refs)
if refs[i] != HDF5.HDF5ReferenceObj_NULL
out[i] = read_ref(f, refs[i])
try
out = Array{T}(dims)
for i = 1:length(refs)
if refs[i] != HDF5.HDF5ReferenceObj_NULL
out[i] = read_ref(f, refs[i])
end
end
return out
catch e
if isa(e, TypeError)
out = Array{Any}(dims)
for i = 1:length(refs)
if refs[i] != HDF5.HDF5ReferenceObj_NULL
out[i] = read_ref(f, refs[i])
end
end
return out
else
rethrow(e)
end
end
out
end

# Get element type of a reference array
Expand Down