[libadwaita] leaflet: Check correctness of direction in adw_leaflet_navigate



commit 6b197c4bd0eee36ee27f3d039e6262507d856a4c
Author: Pablo Correa Gómez <ablocorrea hotmail com>
Date:   Wed Jun 22 16:48:04 2022 +0200

    leaflet: Check correctness of direction in adw_leaflet_navigate
    
    Otherwise, any random value would have the consequence of being
    interpreted as ADW_NAVIGATION_DIRECTION_FORWARD.

 src/adw-leaflet.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/adw-leaflet.c b/src/adw-leaflet.c
index 8d2b88a4..be95385d 100644
--- a/src/adw-leaflet.c
+++ b/src/adw-leaflet.c
@@ -3500,6 +3500,8 @@ adw_leaflet_navigate (AdwLeaflet             *self,
   AdwLeafletPage *page;
 
   g_return_val_if_fail (ADW_IS_LEAFLET (self), FALSE);
+  g_return_val_if_fail (direction == ADW_NAVIGATION_DIRECTION_BACK ||
+                        direction == ADW_NAVIGATION_DIRECTION_FORWARD, FALSE);
 
   page = find_swipeable_page (self, direction);
 


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