Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle null bitmap
  • Loading branch information
Emmanuel Garcia committed Jun 3, 2022
commit 2625afc10bdbff1dc8c5d1eb3bee4ff84404eddb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public static void capture(@NonNull TestableFlutterActivity activity, @NonNull S

final Bitmap bitmap =
InstrumentationRegistry.getInstrumentation().getUiAutomation().takeScreenshot();
if (bitmap == null) {
throw new RuntimeException("failed to capture screenshot");
}
final ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
ScreenshotUtil.writeFile(captureName, out.toByteArray());
Expand Down