diff --git a/Riot/Modules/Room/CellData/RoomBubbleCellData.m b/Riot/Modules/Room/CellData/RoomBubbleCellData.m index 33a34821f..584fca7ae 100644 --- a/Riot/Modules/Room/CellData/RoomBubbleCellData.m +++ b/Riot/Modules/Room/CellData/RoomBubbleCellData.m @@ -1076,7 +1076,7 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat { // Get the last bubble component as that contains the link. MXKRoomBubbleComponent *lastComponent = bubbleComponents.lastObject; - if (!lastComponent) + if (!lastComponent || !lastComponent.link) { return; } diff --git a/changelog.d/4823.bugfix b/changelog.d/4823.bugfix new file mode 100644 index 000000000..87c9df647 --- /dev/null +++ b/changelog.d/4823.bugfix @@ -0,0 +1 @@ +RoomBubbleCellData: Fix crash when creating a URL preview when the link didn't end up in the last bubble component. \ No newline at end of file