autotests: Prevent zero page access

X11 clients might outlive Tabbox. Therefore we need to guard against
that case.
This commit is contained in:
Vlad Zagorodniy 2019-07-29 23:45:21 +03:00
parent e110b126f7
commit ffb2d92e9b

View file

@ -223,7 +223,7 @@ void Client::releaseWindow(bool on_shutdown)
deleting = true;
#ifdef KWIN_BUILD_TABBOX
TabBox::TabBox *tabBox = TabBox::TabBox::self();
if (tabBox->isDisplayed() && tabBox->currentClient() == this) {
if (tabBox && tabBox->isDisplayed() && tabBox->currentClient() == this) {
tabBox->nextPrev(true);
}
#endif
@ -299,7 +299,7 @@ void Client::destroyClient()
deleting = true;
#ifdef KWIN_BUILD_TABBOX
TabBox::TabBox *tabBox = TabBox::TabBox::self();
if (tabBox->isDisplayed() && tabBox->currentClient() == this) {
if (tabBox && tabBox->isDisplayed() && tabBox->currentClient() == this) {
tabBox->nextPrev(true);
}
#endif