Skip to content

Commit 861065c

Browse files
authored
Merge pull request #1013 from JuliaRobotics/23Q2/enh/fixesand212
fix unpackFactor for b64
2 parents 339bcde + 8c900e5 commit 861065c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.21.1"
3+
version = "0.21.2"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/services/DFGVariable.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ Retrieve solver data structure stored in a variable.
425425
"""
426426
function getSolverData(v::DFGVariable, key::Symbol=:default)
427427
#TODO this does not fit in with some of the other error behaviour. but its used so added @error
428-
vnd = haskey(v.solverDataDict, key) ? v.solverDataDict[key] : (@error "Variable $(getLabel(v)) does not have solver data $(key)"; nothing)
428+
vnd = haskey(getSolverDataDict(v), key) ? getSolverDataDict(v)[key] : (@error "Variable $(getLabel(v)) does not have solver data $(key)"; nothing)
429429
return vnd
430430
end
431431

src/services/Serialization.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,13 @@ end
267267
function fncStringToData(packtype::Type{<:AbstractPackedFactor}, data::String)
268268

269269
# Read string as JSON object to use as kwargs
270-
fncData = JSON3.read(data)
270+
fncData = JSON3.read(
271+
if data[1] == '{'
272+
data
273+
else
274+
String(base64decode(data))
275+
end
276+
)
271277
packT = packtype(;fncData.fnc...)
272278

273279
packed = GenericFunctionNodeData{packtype}(

0 commit comments

Comments
 (0)