From f1eaffab4af152dc87b1072f191a5c6a0f85a15c Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Thu, 21 Aug 2025 18:53:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=20Chef=20=E5=92=8C=20Cooks=20?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E8=AE=BE=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/framework/chef.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/framework/chef.c b/src/framework/chef.c index a82b9f8..5352459 100644 --- a/src/framework/chef.c +++ b/src/framework/chef.c @@ -206,8 +206,14 @@ chef_set_chef (Target_t *target, const char *id) { 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; } @@ -222,8 +228,7 @@ chef_set_cooks (Target_t *target, size_t count, ...) if (count == 0) { - target->cooks = NULL; - target->cooks_n = 0; + chsrc_panic ("recipe 一定至少有1位作者(cooks)"); return; }