From: "Rodolfo García Peñas (kix)" <[email protected]>
The function wWorkspaceMenuUpdate() udpates the menu entries
using the scr->current_workspace variable. The problem is that
variable could be NULL, so wmaker will crash.
This patch include a new check to verify that scr->current_workspace
exists before use it.
---
src/workspace.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/workspace.c b/src/workspace.c
index b4cccd0..9eaeb15 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -784,8 +784,11 @@ void wWorkspaceMenuUpdate(WScreen * scr, WMenu * menu)
menu->entries[i + MC_WORKSPACE1]->flags.indicator_on = 0;
}
- menu->entries[scr->current_workspace +
MC_WORKSPACE1]->flags.indicator_on = 1;
- wMenuRealize(menu);
+
+ if (scr->current_workspace) {
+ menu->entries[scr->current_workspace +
MC_WORKSPACE1]->flags.indicator_on = 1;
+ wMenuRealize(menu);
+ }
/* don't let user destroy current workspace */
if (scr->current_workspace == scr->workspace_count - 1) {
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].