From: luozheng <1732036298@qq.com> Date: Sun, 18 Feb 2024 10:53:32 +0000 (+0800) Subject: 修复系统语言退出会死机的问题 X-Git-Tag: release_V1.2.70_20241020_135402~1303 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=a9546b7423334c554fe65ee297b6e0925806bf0d;p=mirrors%2FFD230.git 修复系统语言退出会死机的问题 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp index b118fc18a..de1c7df9a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp @@ -67,7 +67,7 @@ namespace OHOS { for (int i = 1; i < MAX_SYSTEMVIEWID; i++) { - if (p_SystemView->GetSystemScrollView(i)->IsVisible() == true) + if (p_SystemView->GetSystemScrollView(i)!=nullptr && p_SystemView->GetSystemScrollView(i)->IsVisible() == true) { p_SystemView->ChangeView(i, SYSTEMVIEW); break; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp index 6439fba69..85dc04cba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp @@ -272,9 +272,13 @@ namespace OHOS } return true; } - + UIScrollView *SystemView::GetSystemScrollView(int ViewId) { + if (SystemScrollView[ViewId] == nullptr) + { + return nullptr; + } return SystemScrollView[ViewId]; }