Merge "Fix NPE in trimV4AddrZeros." into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
fbb09ea84f
@ -261,6 +261,7 @@ public class NetworkUtils {
|
||||
* @return a string propertly trimmed
|
||||
*/
|
||||
public static String trimV4AddrZeros(String addr) {
|
||||
if (addr == null) return null;
|
||||
String[] octets = addr.split("\\.");
|
||||
if (octets.length != 4) return addr;
|
||||
StringBuilder builder = new StringBuilder(16);
|
||||
|
Reference in New Issue
Block a user