From f044511037a51ae9c438addf3a8374f559916aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 13 Oct 2017 00:10:22 -0500 Subject: [PATCH] monitor-manager: use g_return_val_if_fail if trying to fetch an invalid monitor https://bugzilla.gnome.org/show_bug.cgi?id=788860 --- src/backends/meta-monitor-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 0bb092b73..a657d5098 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -2345,7 +2345,7 @@ MetaLogicalMonitor * meta_monitor_manager_get_logical_monitor_from_number (MetaMonitorManager *manager, int number) { - g_assert ((unsigned int) number < g_list_length (manager->logical_monitors)); + g_return_val_if_fail ((unsigned int) number < g_list_length (manager->logical_monitors), NULL); return g_list_nth (manager->logical_monitors, number)->data; }