提交 f21909ad 编写于 作者: U UlricQin

check resource exists when bind classpath

上级 12e3b3a4
......@@ -59,6 +59,7 @@ var (
"Regexp %s matched, but cannot get substring()": "主正则 %s 匹配成功,但无法匹配到子串",
"TagKey or TagValue contains illegal characters[:,/=\r\n\t]": "标签KEY或者标签值包含非法字符串[:,/=\r\n\t]",
"Resource cannot delete in preset classpath": "预置分组不能删除资源",
"No such resource %s": "不存在该资源(%s)",
}
langDict = map[string]map[string]string{
"zh": dict,
......
......@@ -56,6 +56,15 @@ func ClasspathResourceAdd(classpathId int64, resIdent string) error {
return nil
}
res, err := ResourceGet("ident=?", resIdent)
if err != nil {
return err
}
if res == nil {
return _e("No such resource %s", resIdent)
}
obj := ClasspathResource{
ClasspathId: classpathId,
ResIdent: resIdent,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册