diff options
author | Thomas White <taw@physics.org> | 2021-05-07 13:22:57 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-05-07 13:22:57 +0200 |
commit | 7052eda1975dba37781d64d7e2d2b916e300ccdb (patch) | |
tree | d6aba104bc93900d86912b34fc4918d2a9b90abe /libcrystfel/src/image-msgpack.c | |
parent | ce270ad7d8136aac47a802a9a72c011344f90527 (diff) |
MsgPack: Use top-level object directly if it is a map
Diffstat (limited to 'libcrystfel/src/image-msgpack.c')
-rw-r--r-- | libcrystfel/src/image-msgpack.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcrystfel/src/image-msgpack.c b/libcrystfel/src/image-msgpack.c index e1c9bb66..3465cc71 100644 --- a/libcrystfel/src/image-msgpack.c +++ b/libcrystfel/src/image-msgpack.c @@ -50,6 +50,10 @@ static msgpack_object *find_main_object(msgpack_unpacked *unpacked) { int n_obj; + if ( unpacked->data.type == MSGPACK_OBJECT_MAP ) { + return &unpacked->data; + } + if ( unpacked->data.type != MSGPACK_OBJECT_ARRAY ) { ERROR("MessagePack data isn't an array - ignoring.\n"); return NULL; |