handle null mScanResult for CTS test

This adds one more assert statement to ensure the ScanResult
variable is not null before we proceed.

Bug: 27744749
TEST=run cts test without error

Change-Id: I48f3c5369792d3a55b594b71250b0dfdf0d5282b
This commit is contained in:
Ningyuan Wang
2016-03-22 16:20:27 -07:00
parent a552317982
commit ebbfd8ce11

View File

@@ -296,6 +296,8 @@ public class WifiManagerTest extends AndroidTestCase {
for (int i = 0; i < WIFI_SCAN_TEST_ITERATIONS; ++i) {
startScan();
// Make sure at least one AP is found.
assertTrue("mScanResult should not be null. This may be due to a scan timeout",
mScanResults != null);
assertFalse("empty scan results!", mScanResults.isEmpty());
long nowMillis = SystemClock.elapsedRealtime();
// Keep track of how many APs are fresh in one scan.