Skip to content

Commit b403647

Browse files
committed
Server:引用赋值不允许赋值后值为null
1 parent c6e9c4b commit b403647

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

APIJSON-Java-Server/APIJSON-Eclipse/src/main/java/zuo/biao/apijson/server/Parser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,11 @@ private Object getValueByPath(String valuePath) {
845845

846846
if (parent != null) {
847847
Log.i(TAG, "getValueByPath >> get from queryResultMap >> return parent.get(keys[keys.length - 1]);");
848-
return parent.get(keys[keys.length - 1]); //TODO 值为null是否应该报错? NotExistExeption
848+
target = parent.get(keys[keys.length - 1]); //值为null应该报错NotExistExeption,一般都是id关联,不可为null,否则可能绕过安全机制
849+
if (target != null) {
850+
Log.i(TAG, "getValueByPath >> getValue >> return target = " + target);
851+
return target;
852+
}
849853
}
850854

851855

APIJSON-Java-Server/APIJSON-Eclipse/src/main/java/zuo/biao/apijson/server/sql/SQLConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ else if (key.endsWith("-")) {//缩减,PUT查询时处理
13131313
}
13141314

13151315
if (verifyName && StringUtil.isName(key.startsWith("@") ? key.substring(1) : key) == false) {
1316-
throw new IllegalArgumentException(TAG + "/" + method + " getRealKey: 字符 " + originKey + " 不合法!");
1316+
throw new IllegalArgumentException(method + "请求,字符 " + originKey + " 不合法!");
13171317
}
13181318

13191319
if (saveLogic && last != null) {

0 commit comments

Comments
 (0)