Fix NPE in NsdServiceTest
Continuous test dashboards report that quit() can crash sometimes due to mThread being null. This patch adds a null guard in tearDown(). Bug: 32561414 Test: runtest frameworks-net Change-Id: If66fb47e31e77d25b4741a786f12eb78f0b9102e
This commit is contained in:
@@ -77,7 +77,10 @@ public class NsdServiceTest {
|
|||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
mThread.quit();
|
if (mThread != null) {
|
||||||
|
mThread.quit();
|
||||||
|
mThread = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user