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:
Hugo Benichi
2017-09-26 14:51:11 +09:00
parent d8eae0de70
commit 210ab83b77

View File

@@ -77,7 +77,10 @@ public class NsdServiceTest {
@After
public void tearDown() throws Exception {
mThread.quit();
if (mThread != null) {
mThread.quit();
mThread = null;
}
}
@Test