Skip to content

Commit

Permalink
Check for target and field0 being null
Browse files Browse the repository at this point in the history
  • Loading branch information
md5555 committed May 23, 2016
1 parent 4fdde0f commit f742cdb
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ protected boolean isUsableAddress(NetworkInterface networkInterface, InetAddress
// TODO: Workaround Android DNS reverse lookup issue, still a problem on ICS+?
// http://4thline.org/projects/mailinglists.html#nabble-td3011461
String hostName = address.getHostAddress();
Field field0;
Object target;

Field field0 = null;
Object target = null;

try {

Expand All @@ -68,8 +69,12 @@ protected boolean isUsableAddress(NetworkInterface networkInterface, InetAddress
target = address;
}

field0.setAccessible(true);
field0.set(target, hostName);
if (field != null && target != null && hostName != null) {
field0.setAccessible(true);
field0.set(target, hostName);
} else {
return false;
}

} catch (Exception ex) {
log.log(Level.SEVERE,
Expand Down

0 comments on commit f742cdb

Please sign in to comment.