- first_plugin_path_value = bt_value_array_get(cfg->plugin_paths, 0);
- bt_value_string_get(first_plugin_path_value, &first_plugin_path);
+ if (cfg->plugin_paths && !bt_value_array_is_empty(cfg->plugin_paths)) {
+ first_plugin_path_value = bt_value_array_get(
+ cfg->plugin_paths, 0);
+ bt_value_string_get(first_plugin_path_value,
+ &first_plugin_path);
+ ret = bt_component_factory_load_recursive(component_factory,
+ first_plugin_path);
+ if (ret) {
+ fprintf(stderr, "Failed to dynamically load plugins.\n");
+ goto end;
+ }
+ }