From 72d0a24061f02ee27403f852d883c867823ba35e Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 18 Feb 2020 16:50:03 +0530 Subject: [PATCH] Modified code as image is optional. --- .../List/RightVariable/ListRightVariablePaymentsModel.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePaymentsModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePaymentsModel.swift index 681f2078..63719ec1 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePaymentsModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePaymentsModel.swift @@ -11,7 +11,7 @@ import Foundation public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtocol { public static var identifier: String = "listRVImg" - public var image: ImageViewModel + public var image: ImageViewModel? public var leftLabel: LabelModel public init(image: ImageViewModel, leftLabel: LabelModel) { @@ -44,6 +44,6 @@ public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtoco var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) try container.encode(leftLabel, forKey: .leftLabel) - try container.encode(image, forKey: .image) + try container.encodeIfPresent(image, forKey: .image) } }