diff --git a/src/DataBlobs/services/BlobPacking.jl b/src/DataBlobs/services/BlobPacking.jl index e64cf4e2..82a4df74 100644 --- a/src/DataBlobs/services/BlobPacking.jl +++ b/src/DataBlobs/services/BlobPacking.jl @@ -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 diff --git a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl index 79df5175..38ea1f34 100644 --- a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl +++ b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl @@ -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)