workspace: Don't crash on invalid argument to meta_workspace_index
Mitigates: https://gitlab.gnome.org/GNOME/mutter/-/issues/2559 Mitigates: https://bugs.debian.org/1024438 Signed-off-by: Simon McVittie <smcv@debian.org> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2774>
This commit is contained in:
parent
cb03b46a20
commit
ecdd2aeb85
@ -704,7 +704,10 @@ meta_workspace_index (MetaWorkspace *workspace)
|
||||
{
|
||||
int ret;
|
||||
|
||||
g_return_val_if_fail (META_IS_WORKSPACE (workspace), -1);
|
||||
|
||||
ret = g_list_index (workspace->manager->workspaces, workspace);
|
||||
|
||||
g_return_val_if_fail (ret >= 0, -1);
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user