diff --git a/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java b/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java index 2e4af99..875c0ff 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java @@ -354,7 +354,7 @@ public class LiveUtils { } public static boolean getLiveState(int roomId) { - return liveStateMap.get(roomId); + return liveStateMap.getOrDefault(roomId, false); } public static void reloadLiveState(int roomId) { @@ -363,7 +363,7 @@ public class LiveUtils { try { liveStateMap.put(roomId, json.getJSONObject("data").getInteger("live_status") == 1); } catch (Exception e) { - System.out.println("json = " + json); + Log.i("live state = "+json.toString()); } } }