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 25750c5  fixed null reference exception when constructor is missing 
namespace
25750c5 is described below

commit 25750c5d3394b3da682f738630867c808ab1609f
Author: Josh Tynjala <[email protected]>
AuthorDate: Thu Jun 13 08:45:51 2019 -0700

    fixed null reference exception when constructor is missing namespace
---
 .../internal/as/codegen/ClassDirectiveProcessor.java     | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ClassDirectiveProcessor.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ClassDirectiveProcessor.java
index 08f2704..16cfa1e 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ClassDirectiveProcessor.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ClassDirectiveProcessor.java
@@ -983,17 +983,17 @@ class ClassDirectiveProcessor extends DirectiveProcessor
             // It is ok to omit the namespace
             // We must check the AST, as CM treats all ctors as public no 
matter what the user typed in
             // so the FunctionDefinition will always be in the public namespace
-            if (classScope.getProject().getAllowPrivateConstructors())
+            if( node.getActualNamespaceNode() != null )
             {
-                if (node.getActualNamespaceNode().getName() != 
IASKeywordConstants.PUBLIC
-                        && !func.isPrivate())
+                if (classScope.getProject().getAllowPrivateConstructors())
                 {
-                    problems.add(new 
ConstructorMustBePublicOrPrivateProblem(node.getActualNamespaceNode()));
+                    if (node.getActualNamespaceNode().getName() != 
IASKeywordConstants.PUBLIC
+                            && !func.isPrivate())
+                    {
+                        problems.add(new 
ConstructorMustBePublicOrPrivateProblem(node.getActualNamespaceNode()));
+                    }
                 }
-            }
-            else if( node.getActualNamespaceNode() != null )
-            {
-                if (node.getActualNamespaceNode().getName() != 
IASKeywordConstants.PUBLIC || func.isPrivate())
+                else if (node.getActualNamespaceNode().getName() != 
IASKeywordConstants.PUBLIC || func.isPrivate())
                 {
                     problems.add(new 
ConstructorMustBePublicProblem(node.getActualNamespaceNode()));
                 }

Reply via email to