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());