Skip to content

Commit fbb09ea

Browse files
Robert GreenwaltAndroid (Google) Code Review
authored andcommitted
Merge "Fix NPE in trimV4AddrZeros." into ics-mr1
2 parents 3b5555f + 0faacf0 commit fbb09ea

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/java/android/net/NetworkUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public static String[] makeStrings(Collection<InetAddress> addrs) {
261261
* @return a string propertly trimmed
262262
*/
263263
public static String trimV4AddrZeros(String addr) {
264+
if (addr == null) return null;
264265
String[] octets = addr.split("\\.");
265266
if (octets.length != 4) return addr;
266267
StringBuilder builder = new StringBuilder(16);

0 commit comments

Comments
 (0)