Skip to content

Commit 74f4e73

Browse files
committed
当找不到引用赋值路径对应的非 null 值时在 DEBUG 下返回警告信息
1 parent 83eeaa2 commit 74f4e73

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ else if (value instanceof String) { // //key{}@ getRealKey, 引用赋值路径
423423

424424
if (target == null) { // String#equals(null)会出错
425425
Log.d(TAG, "onParse target == null >> return true;");
426+
427+
if (Log.DEBUG) {
428+
parser.putWarnIfNeed(AbstractParser.KEY_REF, path + "/" + key + ": " + targetPath + " 引用赋值获取路径对应的值为 null!请检查路径是否错误!");
429+
}
430+
426431
// 非查询关键词 @key 不影响查询,直接跳过
427432
if (isTable && (key.startsWith("@") == false || JSONRequest.TABLE_KEY_LIST.contains(key))) {
428433
Log.e(TAG, "onParse isTable && (key.startsWith(@) == false"

0 commit comments

Comments
 (0)