From 6580c86626f62413edda92eaa14f1ea6c8528e5b Mon Sep 17 00:00:00 2001
From: Gaurav Mahlawat <gaurav.mahlawat@axelerant.com>
Date: Mon, 8 Jan 2024 10:28:03 +0530
Subject: [PATCH 1/4] check for the existence of node and
 drupalSettings.bigPipePlaceholderIds before access

---
 core/modules/big_pipe/js/big_pipe.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/modules/big_pipe/js/big_pipe.js b/core/modules/big_pipe/js/big_pipe.js
index 5d592e72f16b..222977461239 100644
--- a/core/modules/big_pipe/js/big_pipe.js
+++ b/core/modules/big_pipe/js/big_pipe.js
@@ -89,10 +89,12 @@
    */
   function checkMutation(node) {
     return Boolean(
-      node.nodeType === Node.ELEMENT_NODE &&
+      node &&
+        node.nodeType === Node.ELEMENT_NODE &&
         node.nodeName === 'SCRIPT' &&
         node.dataset &&
         node.dataset.bigPipeReplacementForPlaceholderWithId &&
+        drupalSettings.bigPipePlaceholderIds &&
         typeof drupalSettings.bigPipePlaceholderIds[
           node.dataset.bigPipeReplacementForPlaceholderWithId
         ] !== 'undefined',
-- 
GitLab


From 02dd89cdf36746c41e94749b454bf2fd6724373e Mon Sep 17 00:00:00 2001
From: hardik patel <hardikpatel@hardiks-MacBook-Pro.local>
Date: Fri, 19 Jan 2024 11:57:34 +0530
Subject: [PATCH 2/4] check for the existence of parent node

---
 core/modules/big_pipe/js/big_pipe.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/modules/big_pipe/js/big_pipe.js b/core/modules/big_pipe/js/big_pipe.js
index 222977461239..0386bd26f83f 100644
--- a/core/modules/big_pipe/js/big_pipe.js
+++ b/core/modules/big_pipe/js/big_pipe.js
@@ -115,7 +115,7 @@
     // occur if the script node was first observed with empty content and then
     // the child text node was added in full later.
     // @see `@ingroup large_chunk` for more information.
-    else if (checkMutation(node.parentNode)) {
+    else if (node.parentNode && checkMutation(node.parentNode)) {
       processReplacement(node.parentNode);
     }
   }
-- 
GitLab


From 896c1e767550848c7a3c6b3791cce555cdec5f82 Mon Sep 17 00:00:00 2001
From: hardik patel <hardikpatel@hardiks-MacBook-Pro.local>
Date: Fri, 19 Jan 2024 12:08:07 +0530
Subject: [PATCH 3/4] Removing existence of node check from checkMutation

---
 core/modules/big_pipe/js/big_pipe.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/core/modules/big_pipe/js/big_pipe.js b/core/modules/big_pipe/js/big_pipe.js
index 0386bd26f83f..b17aa54a5e74 100644
--- a/core/modules/big_pipe/js/big_pipe.js
+++ b/core/modules/big_pipe/js/big_pipe.js
@@ -89,12 +89,10 @@
    */
   function checkMutation(node) {
     return Boolean(
-      node &&
-        node.nodeType === Node.ELEMENT_NODE &&
+      node.nodeType === Node.ELEMENT_NODE &&
         node.nodeName === 'SCRIPT' &&
         node.dataset &&
         node.dataset.bigPipeReplacementForPlaceholderWithId &&
-        drupalSettings.bigPipePlaceholderIds &&
         typeof drupalSettings.bigPipePlaceholderIds[
           node.dataset.bigPipeReplacementForPlaceholderWithId
         ] !== 'undefined',
-- 
GitLab


From 8d9d804c39c0cf9c96f0b0bc46aec742da676e61 Mon Sep 17 00:00:00 2001
From: vakulrai <vakulrai42@gmail.com>
Date: Tue, 23 Jan 2024 19:49:36 +0530
Subject: [PATCH 4/4] 3413079: Fixing the Cannot read properties of null
 (reading 'nodeType') on node.page.body

---
 core/modules/big_pipe/js/big_pipe.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/modules/big_pipe/js/big_pipe.js b/core/modules/big_pipe/js/big_pipe.js
index b17aa54a5e74..0386bd26f83f 100644
--- a/core/modules/big_pipe/js/big_pipe.js
+++ b/core/modules/big_pipe/js/big_pipe.js
@@ -89,10 +89,12 @@
    */
   function checkMutation(node) {
     return Boolean(
-      node.nodeType === Node.ELEMENT_NODE &&
+      node &&
+        node.nodeType === Node.ELEMENT_NODE &&
         node.nodeName === 'SCRIPT' &&
         node.dataset &&
         node.dataset.bigPipeReplacementForPlaceholderWithId &&
+        drupalSettings.bigPipePlaceholderIds &&
         typeof drupalSettings.bigPipePlaceholderIds[
           node.dataset.bigPipeReplacementForPlaceholderWithId
         ] !== 'undefined',
-- 
GitLab

