Skip to content

Commit f1eaffa

Browse files
committed
为 Chef 和 Cooks 人数设限制
1 parent a08ef58 commit f1eaffa

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/framework/chef.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,14 @@ chef_set_chef (Target_t *target, const char *id)
206206
{
207207
xy_cant_be_null (target);
208208

209-
Contributor_t *c = chef_verify_contributor (id);
209+
/* Chef 可为空 */
210+
if (!id)
211+
{
212+
target->chef = NULL;
213+
return;
214+
}
210215

216+
Contributor_t *c = chef_verify_contributor (id);
211217
target->chef = c;
212218
}
213219

@@ -222,8 +228,7 @@ chef_set_cooks (Target_t *target, size_t count, ...)
222228

223229
if (count == 0)
224230
{
225-
target->cooks = NULL;
226-
target->cooks_n = 0;
231+
chsrc_panic ("recipe 一定至少有1位作者(cooks)");
227232
return;
228233
}
229234

0 commit comments

Comments
 (0)