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


The following commit(s) were added to refs/heads/develop by this push:
     new eb74df924 MXMLEventSpecifierNode: fix null exception when an event is 
missing = and quotes
eb74df924 is described below

commit eb74df924f60d005f5f4fb7f828dc3d691b44809
Author: Josh Tynjala <[email protected]>
AuthorDate: Tue Aug 22 13:59:45 2023 -0700

    MXMLEventSpecifierNode: fix null exception when an event is missing = and 
quotes
---
 .../compiler/internal/tree/mxml/MXMLEventSpecifierNode.java       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLEventSpecifierNode.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLEventSpecifierNode.java
index aef1a4b0c..7351827da 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLEventSpecifierNode.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLEventSpecifierNode.java
@@ -155,7 +155,13 @@ class MXMLEventSpecifierNode extends MXMLSpecifierNodeBase
         final IncludeHandler includeHandler =
                 
IncludeHandler.createForASTBuilding(builder.getFileSpecificationGetter(), 
filePath, startOffsetLocal, startOffsetAbsolute);
         includeHandler.setProjectAndCompilationUnit(project, 
builder.getCompilationUnit());
-        final String scriptFragment = attribute.getRawValue();
+        String scriptFragment = attribute.getRawValue();
+        if (scriptFragment == null)
+        {
+            // an exception will be thrown if the string is null
+            // the missing value will result in a compile error elsewhere
+            scriptFragment = "";
+        }
         if (scriptFragment.isEmpty())
         {
             MXMLEmptyEventHandlerProblem problem = new 
MXMLEmptyEventHandlerProblem(attribute);

Reply via email to