diff --git a/core/src/main/java/org/fourthline/cling/android/AndroidNetworkAddressFactory.java b/core/src/main/java/org/fourthline/cling/android/AndroidNetworkAddressFactory.java index c996c4565..74d8bd479 100644 --- a/core/src/main/java/org/fourthline/cling/android/AndroidNetworkAddressFactory.java +++ b/core/src/main/java/org/fourthline/cling/android/AndroidNetworkAddressFactory.java @@ -61,20 +61,20 @@ protected boolean isUsableAddress(NetworkInterface networkInterface, InetAddress try { field0 = InetAddress.class.getDeclaredField("holder"); field0.setAccessible(true); - target = field0.get(address); - field0 = target.getClass().getDeclaredField("hostName"); + target = field0.get(address); + field0 = target.getClass().getDeclaredField("hostName"); } catch( NoSuchFieldException e ) { // Let's try the non-OpenJDK variant - field0 = InetAddress.class.getDeclaredField("hostName"); + field0 = InetAddress.class.getDeclaredField("hostName"); target = address; } if (field0 != null && target != null && hostName != null) { - field0.setAccessible(true); - field0.set(target, hostName); - } else { - return false; - } + field0.setAccessible(true); + field0.set(target, hostName); + } else { + return false; + } } catch (Exception ex) { log.log(Level.SEVERE,