summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/file/js
diff options
context:
space:
mode:
authorAlex Pott <alex.a.pott@googlemail.com>2024-12-30 13:01:49 +0000
committerAlex Pott <alex.a.pott@googlemail.com>2024-12-30 13:01:49 +0000
commit38d18a4f1f172a12374228ce422aa779822b3717 (patch)
tree5d019f394e43048911d8ea21c81dcda67edf6f52 /core/modules/file/js
parentc4c4de2149911b97555a6b53b824391e6a9b8fd2 (diff)
downloaddrupal-38d18a4f1f172a12374228ce422aa779822b3717.tar.gz
drupal-38d18a4f1f172a12374228ce422aa779822b3717.zip
Revert "Issue #3492582 by tom konda, zaryab_drupal, nod_, smustgrave: Replace some of obj && obj.prop with optional chaining"
This reverts commit c4c4de2149911b97555a6b53b824391e6a9b8fd2.
Diffstat (limited to 'core/modules/file/js')
-rw-r--r--core/modules/file/js/file.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modules/file/js/file.js b/core/modules/file/js/file.js
index ddbf6bb988e6..3c6d19a4c388 100644
--- a/core/modules/file/js/file.js
+++ b/core/modules/file/js/file.js
@@ -31,7 +31,7 @@
);
}
- if (settings.file?.elements) {
+ if (settings.file && settings.file.elements) {
elements = settings.file.elements;
Object.keys(elements).forEach(initFileValidation);
}
@@ -47,7 +47,7 @@
);
}
- if (trigger === 'unload' && settings.file?.elements) {
+ if (trigger === 'unload' && settings.file && settings.file.elements) {
elements = settings.file.elements;
Object.keys(elements).forEach(removeFileValidation);
}