Browse Source

Fix text to visual conversion of return command for void-tryped functions

Lucas de Souza 1 year ago
parent
commit
5479f5bdc4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      js/util/parseFromVisual.js

+ 4 - 1
js/util/parseFromVisual.js

@@ -86,7 +86,10 @@ function switchWalker (switchCommand) {
  * @param {Commands.Return} returnCommand
  * */
 function returnWalker (returnCommand) {
-  const expression = expressionWalker(returnCommand.expression);
+  let expression = null;
+  if (returnCommand.expression !== null) {
+    expression = expressionWalker(returnCommand.expression);
+  }
   return {
     type: "return",
     expression,