Skip to content

Commit

Permalink
Merge pull request #1034 from JuliaRobotics/master
Browse files Browse the repository at this point in the history
fast forward
  • Loading branch information
dehann authored Aug 16, 2023
2 parents 9b5aba8 + 17f63da commit e57eac3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/DataBlobs/services/BlobPacking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ function unpackBlob(::Type{format"JSON"}, blob::Vector{UInt8})
return String(copy(blob))
end

unpackBlob(entry::BlobEntry, blob::Vector{UInt8}) = unpackBlob(entry.mimeType, blob)
unpackBlob(eb::Pair{<:BlobEntry, Vector{UInt8}}) = unpackBlob(eb[1], eb[2])


# 2/ FileIO
function packBlob(::Type{T}, data::Any; kwargs...) where T <: DataFormat
Expand Down
6 changes: 5 additions & 1 deletion src/DataBlobs/services/HelpersDataWrapEntryBlob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ function getData(
lbls = (s->s.label).(de_)
idx = sortperm(lbls; rev=getlast)
_first(s) = s
_first(s::AbstractVector) = s[1]
_first(s::AbstractVector) = 0 < length(s) ? s[1] : nothing
de = _first(de_[idx])
if isnothing(de)
@error "Could not find in $vlabel the key $key"
return nothing
end
db = getBlob(dfg, de)

checkhash && assertHash(de, db, hashfunction=hashfunction)
Expand Down

0 comments on commit e57eac3

Please sign in to comment.