Verified Commit 017ad48a authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3492582 by tom konda, alexpott, nod_, zaryab_drupal, smustgrave:...

Issue #3492582 by tom konda, alexpott, nod_, zaryab_drupal, smustgrave: Replace some of obj && obj.prop with optional chaining
parent 5db48676
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -458,7 +458,7 @@

    // If there isn't a form, jQuery.ajax() will be used instead, allowing us to
    // bind Ajax to links as well.
    if (this.element && this.element.form) {
    if (this.element?.form) {
      /**
       * @type {jQuery}
       */
+1 −5
Original line number Diff line number Diff line
@@ -142,11 +142,7 @@
        }
        // Skip processing upon a form validation error on a non-empty
        // machine name.
        if (
          $target.hasClass('error') &&
          $target[0].value &&
          $target[0].value.trim().length
        ) {
        if ($target.hasClass('error') && $target[0].value?.trim().length) {
          return;
        }
        // Figure out the maximum length for the machine name.
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −5
Original line number Diff line number Diff line
@@ -99,11 +99,7 @@ export default class DrupalImageUploadAdapter {
      const response = xhr.response;

      if (!response || response.error) {
        return reject(
          response && response.error && response.error.message
            ? response.error.message
            : genericErrorText,
        );
        return reject(response?.error?.message || genericErrorText);
      }
      // Resolve with the `urls` property and pass the response
      // to allow customizing the behavior of features relying on the upload adapters.
Loading