From d9b4ed885234c974a0beb273bf3f5c2a1fadde02 Mon Sep 17 00:00:00 2001 From: Piotr Kochanowski <63232710+TheKohan@users.noreply.github.com> Date: Fri, 3 Jan 2025 08:16:29 +0100 Subject: [PATCH] Update maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt Co-authored-by: Amanjeet Singh --- .../src/main/java/maestro/orchestra/Orchestra.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt b/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt index e36dd57638..210b3a7cb8 100644 --- a/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt +++ b/maestro-orchestra/src/main/java/maestro/orchestra/Orchestra.kt @@ -758,7 +758,11 @@ class Orchestra( maestro.takeScreenshot(file.sink(), false) }else{ maestro.takePartialScreenshot(sink = file.sink(), bounds = cropped.element.bounds, compressed = false) - } +if (cropped == null){ + maestro.takeScreenshot(file.sink(), false) +} else { + maestro.takePartialScreenshot(sink = file.sink(), bounds = cropped.element.bounds, compressed = false) +} return false }