1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 19:03:04 +00:00

Don't scroll to message log bottom with no messages (GTK client) (#3959)

Fixes: #3956
This commit is contained in:
Mike Gelfand 2022-10-13 16:19:37 -07:00 committed by GitHub
parent a2817faab1
commit 02cbfa917a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,14 +123,15 @@ bool MessageLogWindow::Impl::is_pinned_to_new() const
void MessageLogWindow::Impl::scroll_to_bottom()
{
if (sort_ != nullptr)
auto const row_count = sort_->children().size();
if (row_count == 0)
{
auto const row_count = sort_->children().size();
return;
}
if (auto const iter = sort_->children()[row_count - 1]; iter)
{
view_->scroll_to_row(sort_->get_path(TR_GTK_TREE_MODEL_CHILD_ITER(iter)), 1);
}
if (auto const iter = sort_->children()[row_count - 1]; iter)
{
view_->scroll_to_row(sort_->get_path(TR_GTK_TREE_MODEL_CHILD_ITER(iter)), 1);
}
}