From 4469042e2a16333cf7dada0f750c388eb0184d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 4 Dec 2021 23:39:58 +0100 Subject: [PATCH] workspace: Downgrade abort() to a warning when getting index Instead of crashing on invalid input, just log a warning and return -1. This will hopefully result in less abort():y behavior with missbehaving Javascript code. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4203 Part-of: --- src/core/workspace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/workspace.c b/src/core/workspace.c index 76ba87b5a..3bd517fca 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -717,9 +717,7 @@ meta_workspace_index (MetaWorkspace *workspace) int ret; ret = g_list_index (workspace->manager->workspaces, workspace); - - if (ret < 0) - meta_bug ("Workspace does not exist to index!"); + g_return_val_if_fail (ret >= 0, -1); return ret; }