diff --git a/src/pg/decoder.cr b/src/pg/decoder.cr index c086d5af..1e8c9379 100644 --- a/src/pg/decoder.cr +++ b/src/pg/decoder.cr @@ -134,12 +134,12 @@ module PG # return String.new(ByteaDecoder.new.decode(io,bytesize)) Hash(String, String?).new.tap do |hash| string_decoder = StringDecoder.new - key_count = read_u32(io) + key_count = read_u32(io) # 4 key_count.times do - length = read_u32(io) + length = read_u32(io) # 4 key = string_decoder.decode(io, length) length = read_u32(io) - if length == UInt32::MAX + if length == -1 hash[key] = nil else value = string_decoder.decode(io, length)