Ensure that list is not empty before accessing
With settings to animate windows in boxswitch it was possible that an empty list was accessed when the last window closed. BUG: 263306 FIXED-IN: 4.7.0
This commit is contained in:
parent
1dd614ee4b
commit
032c2cc333
1 changed files with 4 additions and 0 deletions
|
@ -547,6 +547,10 @@ void BoxSwitchEffect::calculateItemSizes()
|
|||
qDeleteAll(windows);
|
||||
windows.clear();
|
||||
if ((mAnimateSwitch && !mProxyActivated) || (mProxyActivated && mProxyAnimateSwitch)) {
|
||||
if (original_windows.isEmpty()) {
|
||||
// can happen when last window is closed.
|
||||
return;
|
||||
}
|
||||
int index = original_windows.indexOf(effects->currentTabBoxWindow());
|
||||
int leftIndex = index;
|
||||
int rightIndex = index + 1;
|
||||
|
|
Loading…
Reference in a new issue