Merge pull request #279 from RyanRory/sending-gif-crash
Fix Crash on Sending Certain GIFs
This commit is contained in:
commit
13630aac6e
|
@ -4098,6 +4098,14 @@ typedef enum : NSUInteger {
|
|||
didApproveAttachments:(NSArray<SignalAttachment *> *)attachments
|
||||
messageText:(NSString *_Nullable)messageText
|
||||
{
|
||||
for (SignalAttachment *attachment in attachments) {
|
||||
if ([attachment hasError]) {
|
||||
OWSLogWarn(@"Invalid attachment: %@.", attachment ? [attachment errorName] : @"Missing data");
|
||||
[self showErrorAlertForAttachment:attachment];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[self tryToSendAttachments:attachments messageText:messageText];
|
||||
[self.inputToolbar clearTextMessageAnimated:NO];
|
||||
[self resetMentions];
|
||||
|
|
|
@ -50,7 +50,9 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD
|
|||
init(attachmentItem: SignalAttachmentItem) {
|
||||
self.attachmentItem = attachmentItem
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
assert(!attachment.hasError)
|
||||
if attachment.hasError {
|
||||
owsFailDebug(attachment.error.debugDescription)
|
||||
}
|
||||
}
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
|
|
|
@ -63,7 +63,9 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
|
|||
// of nice that it's written in a flexible way in case we'd want to use it elsewhere again in the future.
|
||||
@objc
|
||||
public required init(attachment: SignalAttachment, mode: MediaMessageViewMode) {
|
||||
assert(!attachment.hasError)
|
||||
if attachment.hasError {
|
||||
owsFailDebug(attachment.error.debugDescription)
|
||||
}
|
||||
self.attachment = attachment
|
||||
self.mode = mode
|
||||
super.init(frame: CGRect.zero)
|
||||
|
@ -336,7 +338,7 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
|
|||
case .small, .large:
|
||||
return Colors.accent
|
||||
case .attachmentApproval:
|
||||
return UIColor.white
|
||||
return Colors.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue