Fix null pointer exception on bubbles test

When no bubbles exist the following error occurs:

Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
07-28 04:11:01.355  1328  1368 E FLICKER : 	at com.android.wm.shell.flicker.bubble.MultiBubblesScreen$transition$1$2.invoke(MultiBubblesScreen.kt:79)

Bug: 240639586
Test: atest WMShellFlickerTests
Change-Id: I3ef42b65747aff5a4b4da7fa737efabbaba804fc
This commit is contained in:
Nataniel Borges
2022-07-29 08:34:30 +00:00
parent b2f97af57a
commit 8248ab83e1

View File

@@ -75,7 +75,7 @@ open class MultiBubblesScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen
Until.findObjects(
By.res(SYSTEM_UI_PACKAGE, BUBBLE_RES_NAME)
), FIND_OBJECT_TIMEOUT
)
) ?: error("No bubbles found")
for (entry in bubbles) {
entry?.run { entry.click() } ?: error("Bubble not found")
SystemClock.sleep(1000)