From d6675141ebde10fa4e0dfcce8db770797ca2d9ec Mon Sep 17 00:00:00 2001 From: pwx1285814 Date: Mon, 3 Mar 2025 19:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E8=A7=A3=E5=BC=95=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: pwx1285814 Change-Id: Iaaf40742ad1a97c77fa9fbbe73ba35413224c9e6 --- screenhandler/src/dscreen_handler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/screenhandler/src/dscreen_handler.cpp b/screenhandler/src/dscreen_handler.cpp index 36a29ecd..0e42ecac 100644 --- a/screenhandler/src/dscreen_handler.cpp +++ b/screenhandler/src/dscreen_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -151,6 +151,10 @@ std::vector DScreenHandler::Query() uint32_t screenWidth = screen->GetWidth(); if (screenListener_ == nullptr) { screenListener_ = new (std::nothrow) ScreenListener(); + if (screenListener_ == nullptr) { + DHLOGE("New ScreenListener failed, dhID: %{public}s", dhId.c_str()); + continue; + } } screenWidth = screenListener_->ByteCalculate(screenWidth); uint32_t screenHeight = screen->GetHeight(); -- Gitee