Skip to content

Commit 8951066

Browse files
SERVCUBEDgolf1052
authored andcommitted
Fix out of range exception when there are no messages in conversation
1 parent 146bbf1 commit 8951066

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Signal-Windows/Controls/Conversation.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ private async void TextBox_KeyDown(object sender, KeyRoutedEventArgs e)
223223

224224
private void ScrollToBottom()
225225
{
226+
if (ConversationItemsControl.Items.Count == 0)
227+
return;
226228
var lastMsg = ConversationItemsControl.Items[ConversationItemsControl.Items.Count - 1] as SignalMessageContainer;
227229
Debug.WriteLine($"scroll to {lastMsg}");
228230
ConversationItemsControl.ScrollIntoView(lastMsg);

0 commit comments

Comments
 (0)