trivial: Allow running generic vfuncs in the tests without a GModule

This makes it easier to set up test harness in the daemon self tests.
This commit is contained in:
Richard Hughes 2017-11-14 11:34:33 +00:00
parent 2adee9082b
commit d3d96ccbb2

View File

@ -868,6 +868,10 @@ fu_plugin_runner_device_generic (FuPlugin *plugin, FuDevice *device,
if (!priv->enabled) if (!priv->enabled)
return TRUE; return TRUE;
/* no object loaded */
if (priv->module == NULL)
return TRUE;
/* optional */ /* optional */
g_module_symbol (priv->module, symbol_name, (gpointer *) &func); g_module_symbol (priv->module, symbol_name, (gpointer *) &func);
if (func == NULL) if (func == NULL)