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

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit eaf1e32df22752e00ddbc7d758835ec6f325b25d
Author: Alex Harui <[email protected]>
AuthorDate: Mon Sep 10 14:34:44 2018 -0700

    fix NPE on write-only properties
---
 .../compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
index 9e6ae09..569d36e 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java
@@ -722,11 +722,13 @@ abstract class MXMLClassReferenceNodeBase extends 
MXMLNodeBase implements IMXMLC
     {
         // Non-whitespace may be the value of a default property.
         IVariableDefinition defaultPropertyDefinition = 
getDefaultPropertyDefinition(builder);
+        IVariableDefinition getterDefinition = (defaultPropertyDefinition 
instanceof ISetterDefinition) ? 
+                       
((ISetterDefinition)defaultPropertyDefinition).resolveCorrespondingAccessor(builder.getProject())
 :null;
         if (defaultPropertyDefinition != null && 
                        
(defaultPropertyDefinition.getTypeAsDisplayString().equals(IASLanguageConstants.String)
 ||
                         
(defaultPropertyDefinition.getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_RICHTEXTCONTENT)
 != null) ||
-                        (defaultPropertyDefinition instanceof 
ISetterDefinition && 
-                            
((ISetterDefinition)defaultPropertyDefinition).resolveCorrespondingAccessor(builder.getProject()).getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_RICHTEXTCONTENT)
 != null)))
+                        (getterDefinition != null && 
+                            
(getterDefinition.getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_RICHTEXTCONTENT)
 != null))))
         {
             MXMLSpecifierNodeBase childNode =
                     createSpecifierNode(builder, 
defaultPropertyDefinition.getBaseName());

Reply via email to