Skip to content

Commit

Permalink
Do nothing if plugin dir does not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Aug 22, 2024
1 parent 671b33b commit 7882b52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void *plugin_load_from_path(size_t argc, void *args[], void *data)

if (fs::is_directory(fs::path(ext_path)) == false)
{
log_write("metacall", LOG_LEVEL_WARNING, "Folder %s not found, plugins will not be loaded", ext_path.c_str());
return metacall_value_create_int(4);
/* If the directory does not exist, we do nothing */
return metacall_value_create_int(0);
}

void **handle_ptr = NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TEST_F(metacall_plugin_extension_invalid_path_test, DefaultConstructor)

EXPECT_EQ((enum metacall_value_id)METACALL_INT, (enum metacall_value_id)metacall_value_id(result));

EXPECT_EQ((int)4, (int)metacall_value_to_int(result));
EXPECT_EQ((int)0, (int)metacall_value_to_int(result));

metacall_value_destroy(args[0]);
metacall_value_destroy(args[1]);
Expand Down

0 comments on commit 7882b52

Please sign in to comment.