Upon flow creation, not having "tasks" property and trying to add it crashes upon writing the last 's'
### Explain the bug

[Screencast from 27-12-2023 09:42:58.webm](https://github.com/kestra-io/kestra/assets/37618489/c63f5561-81d1-4e51-83b3-bd32703ffaf0)


### Environment Information

- Kestra Version: 0.14.0-SNAPSHOT
- Operating System and Java Version (if not using Kestra Docker image):

ui/src/utils/yamlUtils.js
ui/src/utils/yamlUtils.js
diff --git a/ui/src/utils/yamlUtils.js b/ui/src/utils/yamlUtils.js
index e816ac8279..9e6a90ae9a 100644
--- a/ui/src/utils/yamlUtils.js
+++ b/ui/src/utils/yamlUtils.js
@@ -533,7 +533,7 @@ export default class YamlUtils {
 
     static flowHaveTasks(source) {
         const tasks = yaml.parseDocument(source).contents.items.find(item => item.key.value === "tasks");
-        return tasks && tasks.value.items && tasks.value.items.length >= 1;
+        return tasks?.value?.items?.length >= 1;
     }
 
     static deleteMetadata(source, metadata) {
