Merge "Fix NPE in trimV4AddrZeros." into ics-mr1

This commit is contained in:
Robert Greenwalt
2011-12-07 17:09:05 -08:00
committed by Android (Google) Code Review

View File

@ -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);