From ff81cdb1be04e1728d0cb185c0efdda8b034f263 Mon Sep 17 00:00:00 2001 From: xinking129 Date: Tue, 24 Oct 2023 19:52:19 +0800 Subject: [PATCH] judge nullptr Signed-off-by: xinking129 --- frameworks/native/ability/native/ui_ability.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/native/ability/native/ui_ability.cpp b/frameworks/native/ability/native/ui_ability.cpp index fb62e3ffd5..87c532a7dd 100644 --- a/frameworks/native/ability/native/ui_ability.cpp +++ b/frameworks/native/ability/native/ui_ability.cpp @@ -818,8 +818,8 @@ void UIAbility::OnDisplayMove(Rosen::DisplayId from, Rosen::DisplayId to) newConfig.AddItem( to, AppExecFwk::ConfigurationInner::APPLICATION_DIRECTION, AppExecFwk::GetDirectionStr(height, width)); newConfig.AddItem(to, AppExecFwk::ConfigurationInner::APPLICATION_DENSITYDPI, AppExecFwk::GetDensityStr(density)); - if (application_ == nullptr) { - HILOG_ERROR("application_ is nullptr."); + if (application_ == nullptr || handler_ == nullptr) { + HILOG_ERROR("application_ or handler_ is nullptr."); return; } std::vector changeKeyV;