FIX:core:fix the fix do not crash if plugins are not in config
authorzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 22 Oct 2008 22:14:46 +0000 (22:14 +0000)
committerzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 22 Oct 2008 22:14:46 +0000 (22:14 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1538 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/plugin.c

index 8650a61..d3fdf44 100644 (file)
@@ -260,8 +260,6 @@ plugin_get_type(enum plugin_type type, const char *type_name, const char *name)
        struct name_val *nv;
        struct plugin *pl;
        char *mod_name, *filename=NULL, *corename=NULL;
-       if (!pls)
-               return NULL;
        l=plugin_types[type];
        while (l) {
                nv=l->data;
@@ -269,6 +267,8 @@ plugin_get_type(enum plugin_type type, const char *type_name, const char *name)
                        return nv->val;
                l=g_list_next(l);
        }
+       if (!pls)
+               return NULL;
        lpls=pls->list;
        if(!g_ascii_strcasecmp(type_name, "map"))
                type_name="data";