From e01ab9c48ed3783c582deb0b414e3a0a4a73a0ad Mon Sep 17 00:00:00 2001 From: siguangli Date: Thu, 9 May 2024 11:11:53 +0800 Subject: [PATCH] fix(android): getScreenShot bitmap width or height < 0 (#3842) Co-authored-by: siguangli --- .../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());