[libpeas] Fix peas_engine_set_loaded_plugins() when no plugins are to be loaded.



commit b7fb6917edef5b8da3531d5c2195a762957f470f
Author: Garrett Regier <alias301 gmail com>
Date:   Thu Dec 9 09:33:43 2010 -0800

    Fix peas_engine_set_loaded_plugins() when no plugins are to be loaded.
    
    Before it would segfault.

 libpeas/peas-engine.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index f62e154..7b4725e 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -1071,6 +1071,10 @@ string_in_strv (const gchar  *needle,
                 const gchar **haystack)
 {
   guint i;
+
+  if (haystack == NULL)
+    return FALSE;
+
   for (i = 0; haystack[i] != NULL; i++)
     if (strcmp (haystack[i], needle) == 0)
       return TRUE;



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