[mutter/gnome-3-26] monitor-manager: use g_return_val_if_fail if trying to fetch an invalid monitor



commit bef9829229295ab72c623f748e225edfd66d5272
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Oct 13 00:10:22 2017 -0500

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index fd2aca9..343bb06 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -2273,7 +2273,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;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]