From 0e4051f15df210d447087a69522b26d1d17e20eb Mon Sep 17 00:00:00 2001 From: 502647092 Date: Fri, 29 Sep 2017 18:44:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=AD=E8=A8=80?= =?UTF-8?q?=E7=B1=BB=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- src/main/java/pw/yumc/YumCore/utils/Assert.java | 2 +- src/test/java/pw/yumc/YumCore/mc/ServerPingTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/pw/yumc/YumCore/utils/Assert.java b/src/main/java/pw/yumc/YumCore/utils/Assert.java index fe0be7c..0697a6a 100644 --- a/src/main/java/pw/yumc/YumCore/utils/Assert.java +++ b/src/main/java/pw/yumc/YumCore/utils/Assert.java @@ -41,6 +41,6 @@ public class Assert { } public void runIsAssignable(Class clazz, Consumer consumer) { - runIsTrue(clazz.isAssignableFrom(t.getClass()), () -> consumer.accept(t)); + runIsTrue(t != null && clazz.isAssignableFrom(t.getClass()), () -> consumer.accept(t)); } } \ No newline at end of file diff --git a/src/test/java/pw/yumc/YumCore/mc/ServerPingTest.java b/src/test/java/pw/yumc/YumCore/mc/ServerPingTest.java index be26d34..4b1c1d2 100644 --- a/src/test/java/pw/yumc/YumCore/mc/ServerPingTest.java +++ b/src/test/java/pw/yumc/YumCore/mc/ServerPingTest.java @@ -14,7 +14,7 @@ import pw.yumc.YumCore.bukkit.Log; public class ServerPingTest { @Test public void test() { - val ping = new ServerPing("server.yumc.pw"); + val ping = new ServerPing("play.i5mc.com"); ping.fetchData(); Log.i("version: %s max: %s online: %s motd: %s", ping.getVersionName(), ping.getPlayersMax(), ping.getPlayersOnline(), ping.getMotd());