[gnome-software] gs-plugin-loader: Tidy up anything_ran handling



commit a93ae7330faae239334201cc88e4815ee9b2ea5d
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Sep 1 16:52:53 2020 +0100

    gs-plugin-loader: Tidy up anything_ran handling
    
    `anything_ran` is set to indicate that at least one plugin handled a
    certain job (even if it returned an error). However, it’s not set on all
    error paths in `gs_plugin_loader_call_vfunc()`. Ensure it is, to avoid
    an incorrect error potentially being reported.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 lib/gs-plugin-loader.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 7783f778..7fa663cd 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -524,6 +524,9 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
        if (func == NULL)
                return TRUE;
 
+       /* at least one plugin supports this vfunc */
+       helper->anything_ran = TRUE;
+
        /* fallback if unset */
        if (app == NULL)
                app = gs_plugin_job_get_app (helper->plugin_job);
@@ -797,8 +800,6 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
                                           gs_plugin_action_to_string (action));
        }
 
-       /* success */
-       helper->anything_ran = TRUE;
        return TRUE;
 }
 


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