[mutter] monitor-manager: use g_return_val_if_fail if trying to fetch an invalid monitor



commit f044511037a51ae9c438addf3a8374f559916aae
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 0bb092b..a657d50 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;
 }


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