Fix exception when showing menu for not-running app

Need to check windows.length before checking first window.

https://bugzilla.gnome.org/show_bug.cgi?id=597466
This commit is contained in:
Colin Walters 2009-10-05 16:01:40 -04:00
parent 53d0581377
commit 90ebcd32e3

View File

@ -440,7 +440,7 @@ AppIconMenu.prototype = {
// Display the app windows menu items and the separator between windows
// of the current desktop and other windows.
let activeWorkspace = global.screen.get_active_workspace();
let separatorShown = windows[0].get_workspace() != activeWorkspace;
let separatorShown = windows.length > 0 && windows[0].get_workspace() != activeWorkspace;
for (let i = 0; i < windows.length; i++) {
if (!separatorShown && windows[i].get_workspace() != activeWorkspace) {