Skip to content

Commit

Permalink
Check repo_id and path is not null
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Oct 31, 2023
1 parent cc42c87 commit 0c2e5a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions common/rpc-service.c
Original file line number Diff line number Diff line change
Expand Up @@ -3182,6 +3182,12 @@ char *seafile_get_file_id_by_path (const char *repo_id,
const char *path,
GError **error)
{
if (!repo_id || !path) {
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS,
"Bad arguments");
return NULL;
}

char *rpath = format_dir_path (path);
char *ret = get_obj_id_by_path (repo_id, rpath, FALSE, error);

Expand All @@ -3196,6 +3202,12 @@ char *seafile_get_dir_id_by_path (const char *repo_id,
const char *path,
GError **error)
{
if (!repo_id || !path) {
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS,
"Bad arguments");
return NULL;
}

char *rpath = format_dir_path (path);
char *ret = get_obj_id_by_path (repo_id, rpath, TRUE, error);

Expand Down

0 comments on commit 0c2e5a1

Please sign in to comment.