mirror of
https://github.com/lightbend/config.git
synced 2025-03-23 07:40:25 +08:00
make Path.render() properly handle empty string path elements
This commit is contained in:
parent
21d9b8b358
commit
7c55d91149
@ -152,7 +152,7 @@ final class Path {
|
||||
}
|
||||
|
||||
private void appendToStringBuilder(StringBuilder sb) {
|
||||
if (hasFunkyChars(first))
|
||||
if (hasFunkyChars(first) || first.isEmpty())
|
||||
sb.append(ConfigUtil.renderJsonString(first));
|
||||
else
|
||||
sb.append(first);
|
||||
|
@ -46,6 +46,7 @@ class PathTest extends TestUtils {
|
||||
assertEquals("foo.\"bar*\"", path("foo", "bar*").render())
|
||||
assertEquals("\"foo.bar\"", path("foo.bar").render())
|
||||
assertEquals("foo bar", path("foo bar").render())
|
||||
assertEquals("\"\".\"\"", path("", "").render())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user