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 9bbc3e4b6 JSCPublisher: null check for result of 
resolveQNameToDefinition() when writing HTML template body
9bbc3e4b6 is described below

commit 9bbc3e4b64984aa01a6394bb0e561841ec9b0798
Author: Josh Tynjala <[email protected]>
AuthorDate: Wed Mar 4 12:00:58 2026 -0800

    JSCPublisher: null check for result of resolveQNameToDefinition() when 
writing HTML template body
---
 .../compiler/internal/codegen/js/jsc/JSCPublisher.java      | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jsc/JSCPublisher.java
 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jsc/JSCPublisher.java
index 7771324de..741ad4a7e 100644
--- 
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jsc/JSCPublisher.java
+++ 
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jsc/JSCPublisher.java
@@ -40,12 +40,15 @@ public class JSCPublisher extends MXMLRoyalePublisher
     protected String getTemplateBody(String mainClassQName)
     {
         IDefinition def = project.resolveQNameToDefinition(mainClassQName);
-        IDefinitionNode node = def.getNode();
-        if (node instanceof IMXMLDocumentNode)
+        if (def != null)
         {
-            //we should probably customize MXML too, but for now, pass it to 
the
-            //default implementation -JT
-            return super.getTemplateBody(mainClassQName);
+            IDefinitionNode node = def.getNode();
+            if (node instanceof IMXMLDocumentNode)
+            {
+                //we should probably customize MXML too, but for now, pass it 
to the
+                //default implementation -JT
+                return super.getTemplateBody(mainClassQName);
+            }
         }
         //for ActionScript classes, simply call the constructor by default
         StringBuilder bodyHTML = new StringBuilder();

Reply via email to