Fix an NPE

Also opportunistically remove similar useless calls

Bug: 157433005
Test: manual
Change-Id: I818bce247dd9d59405d3cdae25e69ce7e6c61ba6
Merged-In: I818bce247dd9d59405d3cdae25e69ce7e6c61ba6
(cherry picked from commit 30379cd5f95b96b5cd909df73d315576d8850f76)
diff --git a/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index ba7fb2e..38b3537 100755
--- a/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -165,7 +165,7 @@
             return;
         }
         if (DBG) {
-            Log.d(TAG, String.format("onCreate for %s", mUrl.toString()));
+            Log.d(TAG, String.format("onCreate for %s", mUrl));
         }
 
         final String spec = getIntent().getStringExtra(EXTRA_CAPTIVE_PORTAL_PROBE_SPEC);
@@ -294,7 +294,7 @@
             return;
         }
         if (DBG) {
-            Log.d(TAG, String.format("Result %s for %s", result.name(), mUrl.toString()));
+            Log.d(TAG, String.format("Result %s for %s", result.name(), mUrl));
         }
         logMetricsEvent(result.metricsEvent);
         switch (result) {
@@ -345,7 +345,7 @@
             return super.onOptionsItemSelected(item);
         }
         if (DBG) {
-            Log.d(TAG, String.format("onOptionsItemSelect %s for %s", action, mUrl.toString()));
+            Log.d(TAG, String.format("onOptionsItemSelect %s for %s", action, mUrl));
         }
         done(result);
         return true;