From f12dcc72d9b48b5f962dcaf33636de7ddff7f075 Mon Sep 17 00:00:00 2001 From: Matty Southall Date: Thu, 19 Sep 2013 20:59:50 +0100 Subject: [PATCH] Fix compile error when compiling on OS X --- proxy/src/test/java/net/md_5/bungee/ThrottleTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proxy/src/test/java/net/md_5/bungee/ThrottleTest.java b/proxy/src/test/java/net/md_5/bungee/ThrottleTest.java index 931fdb8a..e16a0878 100644 --- a/proxy/src/test/java/net/md_5/bungee/ThrottleTest.java +++ b/proxy/src/test/java/net/md_5/bungee/ThrottleTest.java @@ -12,7 +12,13 @@ public class ThrottleTest public void testThrottle() throws InterruptedException, UnknownHostException { ConnectionThrottle throttle = new ConnectionThrottle( 5 ); - InetAddress address = InetAddress.getLocalHost(); + InetAddress address; + + try { + address = InetAddress.getLocalHost(); + } catch (UnknownHostException ex) { + address = InetAddress.getByName( null ); + } Assert.assertFalse( "Address should not be throttled", throttle.throttle( address ) ); Assert.assertTrue( "Address should be throttled", throttle.throttle( address ) );