From 7a7b5ef17393d7863d9dc9baa0ebb7c2c20b4eac Mon Sep 17 00:00:00 2001 From: Rana Mouawi Date: Fri, 13 Dec 2024 07:16:59 -0800 Subject: Always initialize ScreenshotLocationInfo. If the screenshot size was less than 1, ScreenshotLocationInfo was not initialized and this led to a NullPointerException. Bug: b/383927821 Flag: EXEMPT bugfix Change-Id: Ie950d33ccc7c66d94d8a646de2e3e57aa75b1d3a --- packages/Shell/src/com/android/shell/BugreportProgressService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/Shell/src') diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index c6555041164d..61f49db07abc 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -2419,8 +2419,8 @@ public class BugreportProgressService extends Service { bugreportLocationInfo = new BugreportLocationInfo(readFile(in)); int screenshotSize = in.readInt(); + screenshotLocationInfo = new ScreenshotLocationInfo(null); for (int i = 1; i <= screenshotSize; i++) { - screenshotLocationInfo = new ScreenshotLocationInfo(null); screenshotLocationInfo.mScreenshotFiles.add(readFile(in)); } -- cgit v1.2.3-59-g8ed1b