Fix decoding

This commit is contained in:
Ali 2020-04-25 10:57:00 +04:00
parent e85f49282d
commit 2a06b2dede

View File

@ -61,6 +61,9 @@ final class AdditionalChatListItemsTable: Table {
var items: [AdditionalChatListItem] = []
self.valueBox.range(self.table, start: self.lowerBound(), end: self.upperBound(), values: { key, value in
assert(key.getInt32(0) == Int32(items.count))
if value.length <= 8 {
return true
}
if let decoded = PostboxDecoder(buffer: value).decodeRootObject() as? AdditionalChatListItem {
items.append(decoded)
}