From efbefe9e0e5a5d27f31ae74224418a1a8abaa881 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Mon, 15 Jul 2019 11:00:11 -0400 Subject: [PATCH] simple-policy: fix bug when finding endpoints --- modules/module-simple-policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/module-simple-policy.c b/modules/module-simple-policy.c index 120b90ef..8eeb3fda 100644 --- a/modules/module-simple-policy.c +++ b/modules/module-simple-policy.c @@ -471,7 +471,7 @@ simple_policy_find_endpoint (WpPolicy *policy, GVariant *props, } /* If not found, return the first endpoint */ - ep = (ptr_array->len > 1) ? + ep = (ptr_array->len > 0) ? g_object_ref (g_ptr_array_index (ptr_array, 0)) : NULL; select_stream: