mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 08:12:40 +00:00
Merge pull request #2794 from vector-im/fix_tap_attachment_sent_failed_crash
RoomVC: Fix crash occurring when tap on an unsent media with retrieved event equal to nil
This commit is contained in:
commit
b4890085bb
2 changed files with 12 additions and 2 deletions
|
@ -4,6 +4,7 @@ Changes in 0.10.1 (2019-XX-XX)
|
|||
Bug fix:
|
||||
* Room cell: The states of direct chat and favorite buttons are reversed in the menu (#2788).
|
||||
* Pasteboard: Fix a crash when passing a nil object to UIPasteboard.
|
||||
* RoomVC: Fix crash occurring when tap on an unsent media with retrieved event equal to nil.
|
||||
|
||||
Changes in 0.10.0 (2019-10-11)
|
||||
===============================================
|
||||
|
|
|
@ -2259,8 +2259,17 @@
|
|||
if (((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.eventSentState == MXEventSentStateFailed)
|
||||
{
|
||||
// Shortcut: when clicking on an unsent media, show the action sheet to resend it
|
||||
MXEvent *selectedEvent = [self.roomDataSource eventWithEventId:((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.eventId];
|
||||
[self dataSource:dataSource didRecognizeAction:kMXKRoomBubbleCellRiotEditButtonPressed inCell:cell userInfo:@{kMXKRoomBubbleCellEventKey:selectedEvent}];
|
||||
NSString *eventId = ((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.eventId;
|
||||
MXEvent *selectedEvent = [self.roomDataSource eventWithEventId:eventId];
|
||||
|
||||
if (selectedEvent)
|
||||
{
|
||||
[self dataSource:dataSource didRecognizeAction:kMXKRoomBubbleCellRiotEditButtonPressed inCell:cell userInfo:@{kMXKRoomBubbleCellEventKey:selectedEvent}];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"[RoomViewController] didRecognizeAction:inCell:userInfo tap on attachment with event state MXEventSentStateFailed. Selected event is nil for event id %@", eventId);
|
||||
}
|
||||
}
|
||||
else if (((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.type == MXKAttachmentTypeSticker)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue