OSDN Git Service

Fix null pointer exception
authorIrfan Sheriff <isheriff@google.com>
Thu, 27 May 2010 00:16:47 +0000 (17:16 -0700)
committerIrfan Sheriff <isheriff@google.com>
Thu, 27 May 2010 00:16:47 +0000 (17:16 -0700)
Bug: 2718857
Change-Id: I4b04284fd5b3a4881297fe15555e9f1ca91d73cb

services/java/com/android/server/NetworkManagementService.java

index 5e0439c..cbbc7be 100644 (file)
@@ -504,8 +504,11 @@ class NetworkManagementService extends INetworkManagementService.Stub {
     }
 
     private String convertQuotedString(String s) {
-      /* Replace \ with \\, then " with \" and add quotes at end */
-      return '"' + s.replaceAll("\\\\","\\\\\\\\").replaceAll("\"","\\\\\"") + '"';
+        if (s == null) {
+            return s;
+        }
+        /* Replace \ with \\, then " with \" and add quotes at end */
+        return '"' + s.replaceAll("\\\\","\\\\\\\\").replaceAll("\"","\\\\\"") + '"';
     }
 
     public void stopAccessPoint() throws IllegalStateException {