changing so that page does not break if server doesn't send the value

This commit is contained in:
Kevin G Christiano 2020-03-13 18:05:01 -04:00
parent 3625a115b9
commit 86d2669bec

View File

@ -51,7 +51,7 @@ import Foundation
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
molecules = try typeContainer.decodeModels2D(codingKey: .molecules)
molecules = try typeContainer.decodeModels2DIfPresent(codingKey: .molecules) ?? [[]]
dropDown = try typeContainer.decode(ItemDropdownEntryFieldModel.self, forKey: .dropDown)
try super.init(from: decoder)
}