mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
RoomViewController: Fix crash occurring when tap on an unsent media with retrieved event equal to nil.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user