From e232ed31014a1b74fd3ddbb3bd8d4b55120e27c2 Mon Sep 17 00:00:00 2001 From: siguangli Date: Wed, 8 May 2024 18:36:04 +0800 Subject: [PATCH] fix(android): getScreenShot bitmap width or height < 0 --- .../src/main/java/com/tencent/mtt/hippy/utils/DevtoolsUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/utils/DevtoolsUtil.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/utils/DevtoolsUtil.java index a8fa329c0af..8217a164977 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/utils/DevtoolsUtil.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/utils/DevtoolsUtil.java @@ -180,7 +180,7 @@ public static void removeFrameCallback(@NonNull List params, @NonNull View view, } public static void getScreenShot(@NonNull List params, @NonNull final View view, @NonNull final Promise promise) { - if (params.isEmpty()) { + if (params.isEmpty() || view.getWidth() <= 0 || view.getHeight() <= 0) { return; } NativeRender renderer = NativeRendererManager.getNativeRenderer(view.getContext());