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 411ada8a222d96032a002319c00f2f4dfa09a9e1 Author: Josh Tynjala <[email protected]> AuthorDate: Tue Apr 23 10:25:32 2024 -0700 MXMLStyleNode: fix exception when CSSDocument.parse() returns null --- RELEASE_NOTES.md | 1 + .../org/apache/royale/compiler/internal/tree/mxml/MXMLStyleNode.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8a015aed4..59198c20a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -25,6 +25,7 @@ Apache Royale Compiler 0.9.11 - compiler: Fix incorrect error or warning positions for CSS content inside `<fx:Style>` tag. - compiler: Fix non-string values in an MXML array sometimes getting incorrectly wrapped in quotes when emitting JavaScript. - compiler: Fix null exception for `<fx:Style>` tags that contain only comments. +- compiler: Fix null exception for `<fx:Style>` tags that contain invalid CSS. - compiler: Fix crash when attempting to use `--remove-circulars=false` with a release build. - debugger: Fix exception when evaluating certain expressions at run-time. - formatter: Added `insert-new-line-else` configuration option. diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLStyleNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLStyleNode.java index 18a926b47..554071270 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLStyleNode.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLStyleNode.java @@ -103,6 +103,10 @@ class MXMLStyleNode extends MXMLNodeBase implements IMXMLStyleNode stream.setLine(getLine()); stream.setCharPositionInLine(cssCharPos); cssDocument = CSSDocument.parse(stream, problems); + if (cssDocument == null) + { + cssDocument = CSSDocumentCache.EMPTY_CSS_DOCUMENT; + } } else {
