This is an automated email from the ASF dual-hosted git repository.

gregdove 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 b49251f5c Fix null reference error for type parameter in 
createLiteralNode. Under some circumstances, 'type' can be null when called, 
(perhaps only with '*'/ANY type). The null 'type' value is checked/avoided in 
higher up call site methods, but not here.
b49251f5c is described below

commit b49251f5cb6654ce13bf41ce35040becb1f8a7ce
Author: greg-dove <[email protected]>
AuthorDate: Sun May 5 10:21:33 2024 +1200

    Fix null reference error for type parameter in createLiteralNode. Under 
some circumstances, 'type' can be null when called, (perhaps only with '*'/ANY 
type).
    The null 'type' value is checked/avoided in higher up call site methods, 
but not here.
---
 .../apache/royale/compiler/internal/tree/mxml/MXMLTreeBuilder.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLTreeBuilder.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLTreeBuilder.java
index 979ea2655..adcec6cfe 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLTreeBuilder.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLTreeBuilder.java
@@ -494,7 +494,7 @@ public class MXMLTreeBuilder
                                               boolean isAttribute)
     {
         Object value = null;
-        if (type.getQualifiedName().equals(IASLanguageConstants.String)
+        if (type != null && 
type.getQualifiedName().equals(IASLanguageConstants.String)
                 && flags.contains(TextParsingFlags.COLLAPSE_WHITE_SPACE))
         {
             // special case for [CollapseWhiteSpace]
@@ -546,7 +546,7 @@ public class MXMLTreeBuilder
 
             value = parseValue(propertyNode, type, text, flags, defaultValue, 
isAttribute);
 
-            if (value == null)
+            if (value == null && type != null)
             {
                 String typeName = type.getQualifiedName();
                 if (typeName.equals(IASLanguageConstants.String) ||

Reply via email to