Skip to content

Commit

Permalink
Allow creator_name in commit object to be NULL for compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
killing committed Nov 12, 2015
1 parent 85b1639 commit 95d6730
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common/commit-mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ commit_from_json_object (const char *commit_id, json_t *object)
if (!repo_id || !is_uuid_valid(repo_id) ||
!root_id || !is_object_id_valid(root_id) ||
!creator || strlen(creator) != 40 ||
!creator_name ||
(parent_id && !is_object_id_valid(parent_id)) ||
(second_parent_id && !is_object_id_valid(second_parent_id)))
return commit;
Expand All @@ -740,7 +739,7 @@ commit_from_json_object (const char *commit_id, json_t *object)
return NULL;
}

char *creator_name_l = g_ascii_strdown (creator_name, -1);
char *creator_name_l = creator_name ? g_ascii_strdown (creator_name, -1) : NULL;
commit = seaf_commit_new (commit_id, repo_id, root_id,
creator_name_l, creator, desc, ctime);
g_free (creator_name_l);
Expand Down

0 comments on commit 95d6730

Please sign in to comment.