Group Group Group Group Group Group Group Group Group

Tree Deserialize solution bug

#1

Hello,

On page 339, solution for deserialize the tree need extra condition

// 2
guard let value = array.removeFirst() else {

should be changed to:
// 2
guard !array.isEmpty, let value = array.removeFirst() else {

Otherwise it results in error “Can’t remove first element from empty collection”

Best,