From d9ccf43fb0e7aea50e97708158b2498109d82675 Mon Sep 17 00:00:00 2001 From: zhengyongjie <15531316327@163.com> Date: Tue, 4 Jun 2024 17:14:38 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20dfe007e=20from=20https://gitee.com/a-si?= =?UTF-8?q?mple-and-honest-hero/applications=5Flauncher/pulls/520=20master?= =?UTF-8?q?=E7=A8=B3=E5=AE=9A=E6=80=A7=E4=BF=AE=E6=94=B9=C2=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhengyongjie <15531316327@163.com> --- .../main/ets/default/common/components/SwiperPage.ets | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets b/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets index 7bfda4fa..6340c15d 100644 --- a/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets +++ b/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets @@ -22,7 +22,8 @@ import { EventConstants, CardItemInfo, FolderData, - BadgeManager + BadgeManager, + CheckEmptyUtils } from '@ohos/common'; import AppItem from './AppItem'; import FormItem from './FormItem'; @@ -83,7 +84,11 @@ export default struct SwiperPage { */ updateOpenFolderData() { const openFolderData = AppStorage.get('openFolderData') as FolderData; - if (openFolderData?.folderId && this.mAppListInfo.length) { + if (CheckEmptyUtils.isEmptyArr(this.mAppListInfo)) { + Log.showError(TAG, 'mAppListInfo is empty'); + return; + } + if (openFolderData?.folderId && this.mAppListInfo?.length) { let temp = this.mAppListInfo.find((item: LauncherDragItemInfo) => item?.folderId === openFolderData.folderId); AppStorage.setOrCreate('openFolderData', temp as FolderData); } -- Gitee