Solve segmentation fault in case of plugin error on cli.
@@ -672,6 +672,8 @@ application::application(int argc, char *argv[]) :
const char *plugin_path = metacall_plugin_path();
void *plugin_extension_handle = metacall_plugin_extension();
+ if (plugin_path != NULL && plugin_extension_handle != NULL)
+ {
/* Define the cli plugin path as string (core plugin path plus cli) */
namespace fs = std::filesystem;
fs::path plugin_cli_path(plugin_path);
@@ -694,6 +696,7 @@ application::application(int argc, char *argv[]) :
metacall_value_destroy(args[0]);
metacall_value_destroy(args[1]);
metacall_value_destroy(ret);
+ }
/* Define available commands */
define("help", &command_cb_help);
