diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp
index 92fe1842e..ede83f1f0 100644
--- a/Telegram/SourceFiles/history/history_item.cpp
+++ b/Telegram/SourceFiles/history/history_item.cpp
@@ -356,7 +356,9 @@ Storage::SharedMediaTypesMask HistoryItem::sharedMediaTypes() const {
 
 void HistoryItem::indexAsNewItem() {
 	if (IsServerMsgId(id)) {
+		CrashReports::SetAnnotation("addToUnreadMentions", QString::number(id));
 		addToUnreadMentions(UnreadMentionType::New);
+		CrashReports::ClearAnnotation("addToUnreadMentions");
 		if (const auto types = sharedMediaTypes()) {
 			Auth().storage().add(Storage::SharedMediaAddNew(
 				history()->peer->id,
diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp
index 7e3ee86f8..8247ff530 100644
--- a/Telegram/SourceFiles/mediaview.cpp
+++ b/Telegram/SourceFiles/mediaview.cpp
@@ -3028,12 +3028,18 @@ void MediaView::findCurrent() {
 			? (_index | func::add(*_sharedMediaData->skippedBefore()))
 			: base::none;
 		_fullCount = _sharedMediaData->fullCount();
+		if (_index) {
+			Assert(*_index >= 0 && *_index < _sharedMediaData->size());
+		}
 	} else if (_userPhotosData) {
 		_index = _photo ? _userPhotosData->indexOf(_photo->id) : base::none;
 		_fullIndex = _userPhotosData->skippedBefore()
 			? (_index | func::add(*_userPhotosData->skippedBefore()))
 			: base::none;
 		_fullCount = _userPhotosData->fullCount();
+		if (_index) {
+			Assert(*_index >= 0 && *_index < _userPhotosData->size());
+		}
 	} else {
 		_index = _fullIndex = _fullCount = base::none;
 	}