Skip to content

Commit 1802d9b

Browse files
zakalibitAlex Revetchi
andauthored
- fix UDT Value hitting the correct ctor (#509)
Co-authored-by: Alex Revetchi <[email protected]>
1 parent eabb8d6 commit 1802d9b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/decoder.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ Value Decoder::decode_value(const DataType::ConstPtr& data_type) {
148148
remaining_ -= size;
149149

150150
int32_t count = 0;
151-
if (data_type->is_collection() && !decoder.decode_int32(count)) {
152-
return Value();
151+
if (!data_type->is_collection()) {
152+
return Value(data_type, decoder);
153+
} else if (decoder.decode_int32(count)) {
154+
return Value(data_type, count, decoder);
153155
}
154-
return Value(data_type, count, decoder);
156+
return Value();
155157
}
156158
return Value(data_type);
157159
}

0 commit comments

Comments
 (0)