This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 575793f0c4d277ff49aa91c82bc93be6fc25077e Author: Josh Tynjala <[email protected]> AuthorDate: Tue May 28 14:08:58 2024 -0700 compiler: Fix null pointer exception when omitting quoted <fx:Vector> value for fixed and type attributes --- RELEASE_NOTES.md | 1 + .../royale/compiler/internal/tree/mxml/MXMLVectorNode.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d0a768eb1..e0dcb5337 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -36,6 +36,7 @@ Apache Royale Compiler 0.9.11 - compiler: Fix crash when `[Style]` is of type `Object` and value is passed in MXML. - compiler: Fix null pointer exception when omitting quoted `<fx:Style>` value for `source` attribute. - compiler: Fix null pointer exception when omitting quoted `<fx:Binding>` value for `source`, `destination`, and `twoWay` attributes. +- compiler: Fix null pointer exception when omitting quoted `<fx:Vector>` value for `fixed`, and `type` attributes. - compiler: Fix missing problem for invalid `twoWay` value for `<fx:Binding>` tag. - compiler: Fix exception for unexpected attributes added to `<fx:Array>` and `<fx:Vector>` tags. - compiler: Changed to better problem message when MXML `implements` attribute is empty. diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java index 82b417bd8..a93d95934 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLVectorNode.java @@ -109,7 +109,11 @@ class MXMLVectorNode extends MXMLInstanceNode implements IMXMLVectorNode if (attribute.isSpecialAttribute(ATTRIBUTE_TYPE)) { RoyaleProject project = builder.getProject(); - IDefinition def = resolveElementType(value, project); + IDefinition def = null; + if (value != null) + { + def = resolveElementType(value, project); + } if (def instanceof ITypeDefinition) { @@ -124,6 +128,10 @@ class MXMLVectorNode extends MXMLInstanceNode implements IMXMLVectorNode else if (attribute.isSpecialAttribute(ATTRIBUTE_FIXED)) { // TODO Improve this when we implement type recognition for text values. + if (value == null) + { + value = ""; + } value = attribute.getMXMLDialect().trim(value); if (value.equals(IASLanguageConstants.TRUE)) {
