Swapped a force-unwrap to an optional unwrap

This commit is contained in:
Morgan Pretty 2022-03-24 13:42:49 +11:00
parent 88f63c1434
commit 990edd20df

View file

@ -9,7 +9,7 @@ final class LinkPreviewView : UIView {
private lazy var imageViewContainerHeightConstraint = imageView.set(.height, to: 100)
private lazy var sentLinkPreviewTextColor: UIColor = {
let isOutgoing = (viewItem!.interaction.interactionType() == .outgoingMessage)
let isOutgoing = (viewItem?.interaction.interactionType() == .outgoingMessage)
switch (isOutgoing, AppModeManager.shared.currentAppMode) {
case (true, .dark), (false, .light): return .black
case (true, .light): return Colors.grey