为 Chef 和 Cooks 人数设限制

This commit is contained in:
Aoran Zeng 2025-08-21 18:53:25 +08:00
parent a08ef58579
commit f1eaffab4a
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98

View File

@ -206,8 +206,14 @@ chef_set_chef (Target_t *target, const char *id)
{ {
xy_cant_be_null (target); xy_cant_be_null (target);
Contributor_t *c = chef_verify_contributor (id); /* Chef 可为空 */
if (!id)
{
target->chef = NULL;
return;
}
Contributor_t *c = chef_verify_contributor (id);
target->chef = c; target->chef = c;
} }
@ -222,8 +228,7 @@ chef_set_cooks (Target_t *target, size_t count, ...)
if (count == 0) if (count == 0)
{ {
target->cooks = NULL; chsrc_panic ("recipe 一定至少有1位作者(cooks)");
target->cooks_n = 0;
return; return;
} }