You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2021/08/04 18:50:00 UTC

[royale-compiler] 02/02: JSRoyaleASDocEmitter: similar null check for return type as for parameter type

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

commit fd67d58a44f66a945858002735bd94fb0bfe15c1
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed Aug 4 11:45:37 2021 -0700

    JSRoyaleASDocEmitter: similar null check for return type as for parameter type
---
 .../internal/codegen/js/royale/JSRoyaleASDocEmitter.java       | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java
index 5390471..1d013b5 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java
@@ -593,9 +593,17 @@ public class JSRoyaleASDocEmitter extends JSGoogEmitter implements IJSRoyaleEmit
         }
         write("  \"return\": \"");
         if (node.getReturnType().equals("void"))
+		{
         	write("void");
+		}
         else if (node.getReturnTypeNode() != null)
-        	write(formatQualifiedName(node.getReturnTypeNode().resolveType(getWalker().getProject()).getQualifiedName()));
+		{
+			ITypeDefinition returnDef = node.getReturnTypeNode().resolveType(getWalker().getProject());
+			if (returnDef != null)
+			{
+        		write(formatQualifiedName(returnDef.getQualifiedName()));
+			}
+		}
         writeNewline("\",");
         write("  \"params\": [");
         boolean firstParam = true;