From e18eb23607c550e642f674051fd19b616c5faadd Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Wed, 22 Nov 2023 10:22:51 +0800
Subject: [PATCH] 优化业务基类容错性

---
 bases/Pilot.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bases/Pilot.js b/bases/Pilot.js
index 7a849af..f5208f8 100644
--- a/bases/Pilot.js
+++ b/bases/Pilot.js
@@ -106,7 +106,7 @@
                     const nextPage = currentPages[pageIndex + 1];
                     if (nextPage) {
                         clearInterval(timer);
-                        nextPage.$component.$onMessage(action, nextData);
+                        nextPage.$component?.$onMessage(action, nextData);
                     }
                 }, 50);
             } else if (pageType === 'prevPage') {
@@ -114,12 +114,12 @@
                 const pageIndex = currentPages.findIndex(page => page.$component === $vm);
                 const prevPage = currentPages[pageIndex - 1];
                 if (prevPage) {
-                    prevPage.$component.$onMessage(action, nextData);
+                    prevPage.$component?.$onMessage(action, nextData);
                 }
             } else if (pageType === 'rootPage') {
                 const currentPages = getCurrentPages();
                 const rootPage = currentPages[0];
-                rootPage.$component.$onMessage(action, nextData);
+                rootPage.$component?.$onMessage(action, nextData);
             }
         };
     }

--
Gitblit v1.9.1