From 21ab3fbbcb4fcd640f8eb1902915bf0c54447adf Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 12 Dec 2018 10:06:21 -0500 Subject: [PATCH] Respond to CR. --- .../ConversationView/Cells/ConversationMediaView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift b/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift index b442fcfaa..deda1f9dd 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift +++ b/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift @@ -214,11 +214,15 @@ public class ConversationMediaView: UIView { loadBlock = { [weak self] in AssertIsOnMainThread() + guard let strongSelf = self else { + return + } + if animatedImageView.image != nil { owsFailDebug("Unexpectedly already loaded.") return } - self?.tryToLoadMedia(loadMediaBlock: { () -> AnyObject? in + strongSelf.tryToLoadMedia(loadMediaBlock: { () -> AnyObject? in guard attachmentStream.isValidImage else { owsFailDebug("Ignoring invalid attachment.") return nil