Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit492e1a2

Browse files
author
Thomas
committed
check false key and ignore the field
1 parent27fa719 commit492e1a2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/util/AdvancedMapUtils.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class AdvancedMapUtils {
1313
*/
1414
publicstaticStringgetString(Map<String,Object>map,Stringkey) {
1515
if(key ==null)returnnull;
16+
if(key.equals("false"))returnnull;
1617
String[]parts =key.split("\\.");
1718
Objectcurrent =map;
1819

‎server/api-service/lowcoder-server/src/test/java/org/lowcoder/api/authentication/AdvancedMapUtilsTest.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ public void testGetStringFromMap() throws Exception {
1717
Collections.singletonMap("def",Collections.singletonMap("hi","hello world")),
1818
Collections.singletonMap("def",Collections.singletonMap("hi","another value"))
1919
));
20+
nestedMap.put("false","123");
2021

2122
Stringvalue0 =AdvancedMapUtils.getString(nestedMap,"abc[0].def.hi");
2223
Stringvalue1 =AdvancedMapUtils.getString(nestedMap,"abc[1].def.hi");
24+
Stringvalue2 =AdvancedMapUtils.getString(nestedMap,"false");
2325
Assertions.assertSame("hello world",value0);
2426
Assertions.assertSame("another value",value1);
27+
Assertions.assertSame(null,value2);
2528
}
2629
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp