[SYSUI] Fix logging on test failure

The failure fixture may crash on its own - masking actual failures.

Bug: 152820718
Test: atest com.android.systemui.statusbar.policy.NetworkControllerSignalTest
Test: atest com.android.systemui.statusbar.policy.NetworkControllerWifiTest
Change-Id: I1f5ef7d908757205fd30112a753ec616fcb3d42e
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index 6a9e096..b5f57b6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -122,6 +122,10 @@
     public TestWatcher failWatcher = new TestWatcher() {
         @Override
         protected void failed(Throwable e, Description description) {
+            if (mNetworkController == null) {
+                Log.d(TAG, "mNetworkController = null!");
+                return;
+            }
             // Print out mNetworkController state if the test fails.
             StringWriter sw = new StringWriter();
             PrintWriter pw = new PrintWriter(sw);