Validate If task return 500 instead of 422
### Expected Behavior

When writing a flow, if a write a `If task` and there is no `then` properties, it return 500 instead of 422.

This lead to a pop-up spamming.

### Actual Behaviour

It should return 422 and not be displayed in a pop-up but only in the tooltip.

### Steps To Reproduce

Write if task

### Environment Information

- Kestra Version: 0.8.1

### Example flow

_No response_
core/src/main/java/io/kestra/core/tasks/flows/If.java
core/src/main/java/io/kestra/core/tasks/flows/If.java
diff --git a/core/src/main/java/io/kestra/core/tasks/flows/If.java b/core/src/main/java/io/kestra/core/tasks/flows/If.java
index b0153d71a9..f23b1c9319 100644
--- a/core/src/main/java/io/kestra/core/tasks/flows/If.java
+++ b/core/src/main/java/io/kestra/core/tasks/flows/If.java
@@ -129,7 +129,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List<String>
     public List<Task> allChildTasks() {
         return Stream
             .concat(
-                this.then.stream(),
+                this.then != null ? this.then.stream() : Stream.empty(),
                 Stream.concat(
                     this._else != null ? this._else.stream() : Stream.empty(),
                     this.errors != null ? this.errors.stream() : Stream.empty())
