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 c14e5b832eeb0064f00eeb27c6943c9a83299a62 Author: Josh Tynjala <[email protected]> AuthorDate: Tue May 28 13:29:53 2024 -0700 compiler: Fix null pointer exception when omitting quoted <fx:Style> value for source attribute --- RELEASE_NOTES.md | 1 + .../royale/compiler/internal/tree/mxml/MXMLNodeBase.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 977cf428b..c775e8638 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -34,6 +34,7 @@ Apache Royale Compiler 0.9.11 - compiler: Added CSS support for several translate, rotate, scale, skew, and matrix transformation functions in JS. - compiler: Add CSS support for declaring custom properties (CSS variables) and using `var` function in JS. - 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. - debugger: Fix exception when evaluating certain expressions at run-time. - formatter: Added `insert-new-line-else` configuration option. - formatter: Filtered out unnecessary compiler warnings. diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBase.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBase.java index b511f6384..1da7108b7 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBase.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLNodeBase.java @@ -162,7 +162,16 @@ public abstract class MXMLNodeBase extends NodeBase implements IMXMLNode if (info != null) info.hasSourceAttribute = true; - String sourcePath = attribute.getMXMLDialect().trim(attribute.getRawValue()); + String sourcePath = null; + String rawAttributeValue = attribute.getRawValue(); + if (rawAttributeValue != null) + { + sourcePath = attribute.getMXMLDialect().trim(rawAttributeValue); + } + if (sourcePath == null) + { + sourcePath = ""; + } if (sourcePath.isEmpty() && builder != null) {
