Skip to content

Commit 7882b52

Browse files
committed
Do nothing if plugin dir does not exist.
1 parent 671b33b commit 7882b52

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/extensions/plugin_extension/source/plugin_extension.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ void *plugin_load_from_path(size_t argc, void *args[], void *data)
7070

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

7777
void **handle_ptr = NULL;

source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ TEST_F(metacall_plugin_extension_invalid_path_test, DefaultConstructor)
5050

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

53-
EXPECT_EQ((int)4, (int)metacall_value_to_int(result));
53+
EXPECT_EQ((int)0, (int)metacall_value_to_int(result));
5454

5555
metacall_value_destroy(args[0]);
5656
metacall_value_destroy(args[1]);

0 commit comments

Comments
 (0)