mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 16:22:39 +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:
|
Bug fix:
|
||||||
* Room cell: The states of direct chat and favorite buttons are reversed in the menu (#2788).
|
* 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.
|
* 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)
|
Changes in 0.10.0 (2019-10-11)
|
||||||
===============================================
|
===============================================
|
||||||
|
|
|
@ -2259,9 +2259,18 @@
|
||||||
if (((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.eventSentState == MXEventSentStateFailed)
|
if (((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.eventSentState == MXEventSentStateFailed)
|
||||||
{
|
{
|
||||||
// Shortcut: when clicking on an unsent media, show the action sheet to resend it
|
// Shortcut: when clicking on an unsent media, show the action sheet to resend it
|
||||||
MXEvent *selectedEvent = [self.roomDataSource eventWithEventId:((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.eventId];
|
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}];
|
[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)
|
else if (((MXKRoomBubbleTableViewCell*)cell).bubbleData.attachment.type == MXKAttachmentTypeSticker)
|
||||||
{
|
{
|
||||||
// We don't open the attachments viewer when the user taps on a sticker.
|
// We don't open the attachments viewer when the user taps on a sticker.
|
||||||
|
|
Loading…
Reference in a new issue