mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-22 21:16:40 -04:00
MinimizeAll传入非法返回值时报错
Signed-off-by: chenqinxin <chenqinxin1@huawei.com> Change-Id: Id401aba426429cefa193fcd37683c71902887f8b
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <ability.h>
|
||||
#include <cinttypes>
|
||||
#include "ability_context.h"
|
||||
#include "display_manager.h"
|
||||
#include "dm_common.h"
|
||||
#include "js_window.h"
|
||||
#include "js_window_utils.h"
|
||||
@@ -323,7 +324,13 @@ NativeValue* JsWindowManager::OnMinimizeAll(NativeEngine& engine, NativeCallback
|
||||
WLOGFE("Failed to convert parameter to displayId");
|
||||
errCode = WMError::WM_ERROR_INVALID_PARAM;
|
||||
}
|
||||
WLOGFI("displayId %{public}" PRIu64"", static_cast<uint64_t>(displayId));
|
||||
if (displayId < 0 ||
|
||||
SingletonContainer::Get<DisplayManager>().GetDisplayById(static_cast<uint64_t>(displayId)) == nullptr) {
|
||||
WLOGFE("displayId is invalid");
|
||||
errCode = WMError::WM_ERROR_INVALID_PARAM;
|
||||
} else {
|
||||
WLOGFI("displayId %{public}" PRIu64"", static_cast<uint64_t>(displayId));
|
||||
}
|
||||
AsyncTask::CompleteCallback complete =
|
||||
[=](NativeEngine& engine, AsyncTask& task, int32_t status) {
|
||||
if (errCode != WMError::WM_OK) {
|
||||
|
||||
Reference in New Issue
Block a user