Skip to content

Commit 2a02ecb

Browse files
committed
🐛 添加数据校验 #161
1 parent 97c0ac0 commit 2a02ecb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pkg/utils/script.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ export function prepareScriptByCode(
224224
if (metadata.name === undefined) {
225225
throw new Error("脚本名不能为空");
226226
}
227+
if (metadata.version === undefined) {
228+
throw new Error("脚本@version版本不能为空");
229+
}
230+
if (metadata.namespace === undefined) {
231+
throw new Error("脚本@namespace命名空间不能为空");
232+
}
227233
let type = SCRIPT_TYPE_NORMAL;
228234
if (metadata.crontab !== undefined) {
229235
type = SCRIPT_TYPE_CRONTAB;

0 commit comments

Comments
 (0)