Skip to content

Commit f3b17c1

Browse files
Merge pull request #231 from oracle/jira-wdt-46-npe-whitespace
JIRA WDT-46 Avoid assigning non-parsable value in YAML
2 parents 8c5accb + 83ea2f8 commit f3b17c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/src/main/java/oracle/weblogic/deploy/yaml/AbstractYamlTranslator.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
* The Universal Permissive License (UPL), Version 1.0
44
*/
55
package oracle.weblogic.deploy.yaml;
@@ -72,7 +72,11 @@ public void enterAssign(YamlParser.AssignContext ctx) {
7272
PyObject value = getAssignValue(name, ctx);
7373

7474
PyDictionary container = currentDict.peek();
75-
container.__setitem__(new PyString(name), value);
75+
76+
// null indicates not parsable, Py.None would be returned for legitimate cases
77+
if (value != null) {
78+
container.__setitem__(new PyString(name), value);
79+
}
7680
}
7781

7882
/**

0 commit comments

Comments
 (0)