fix: only unpause if a selected page exists (#5637)

* fix: only unpause if a selected page exists

* chore: add changelog entry

* nit: reduce changes

---------

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2024-10-09 11:27:16 +02:00
committed by GitHub
parent afa8067a20
commit f04e7e54e4
2 changed files with 2 additions and 8 deletions
+1 -7
View File
@@ -113,20 +113,14 @@ bool Window::event(QEvent *event)
}
case QEvent::WindowDeactivate: {
for (const auto &split :
this->notebook_->getSelectedPage()->getSplits())
{
split->unpause();
}
auto *page = this->notebook_->getSelectedPage();
if (page != nullptr)
{
std::vector<Split *> splits = page->getSplits();
for (Split *split : splits)
{
split->unpause();
split->updateLastReadMessage();
}