Skip to content

Commit

Permalink
plugin-loader: refuse loading plugins with no metadata
Browse files Browse the repository at this point in the history
This can happen e.g. if a plugin was installed after Wayfire was started (and thus wf-config did not update its metadata), or if a metadata file is not installed correctly.

This avoids a crash later when the plugin tries to load its configuration.
  • Loading branch information
dkondor committed Jan 12, 2025
1 parent cf9afed commit ec825d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/plugin-loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ void wf::plugin_manager_t::reload_dynamic_plugins()
continue;
}

auto config_section = wf::get_core().config.get_section(plugin_name);
if (config_section == nullptr)
{
LOGE(plugin_name,
" has no configuration, skipping. "
"Usual reasons for this include missing or outdated plugin XML files, "
"or mismatch between the versions of Wayfire and wf-config. "
"Make sure that you have the correct versions of all relevant packages and make sure that there ",
"are no conflicting installations of Wayfire using the same prefix. "
"Note that if this plugin was newly installed, you need to restart Wayfire before using it.");
continue;
}

next_plugins.push_back(plugin_path.value());
} else
{
Expand Down

0 comments on commit ec825d0

Please sign in to comment.