!7050 代码检视,添加安全检查

Merge pull request !7050 from dinghong/fix_ffi
This commit is contained in:
openharmony_ci 2024-06-25 06:46:36 +00:00 committed by Gitee
commit 03ce788801
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -134,6 +134,9 @@ int32_t WindowManagerImpl::FindWindow(std::string name, int64_t& windowId)
return static_cast<int32_t>(WmErrorCode::WM_ERROR_STATE_ABNORMALLY);
} else {
sptr<CJWindowImpl> newWindow = CreateCjWindowObject(window);
if (newWindow == nullptr) {
return static_cast<int32_t>(WmErrorCode::WM_ERROR_STATE_ABNORMALLY);
}
windowId = newWindow->GetID();
return WINDOW_SUCCESS;
}