Skip to content

Commit f26ca1e

Browse files
committed
Updater message change
1 parent 1097dc8 commit f26ca1e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/me/rothes/protocolstringreplacer/Updater.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ private void checkJson(String json) {
160160
private void sendJsonMessage(JsonObject json, String id) {
161161
JsonObject msgJson = json.getAsJsonObject("Message");
162162
String msg = getLocaledJsonMessage(msgJson);
163+
if (msg == null) {
164+
return;
165+
}
163166

164167
int msgTimes = json.has("Message_Times") ? json.get("Message_Times").getAsInt() : -1;
165168
int curTimes = msgTimesMap.get(id) == null ? 0 : msgTimesMap.get(id);
@@ -204,10 +207,10 @@ private void checkActions(JsonArray actions) {
204207
}
205208

206209
private String getLocaledJsonMessage(@NotNull JsonObject messageJson) {
207-
String msg;
210+
String msg = null;
208211
if (messageJson.has(PsrLocalization.getLocale())) {
209212
msg = messageJson.get(PsrLocalization.getLocale()).getAsString();
210-
} else {
213+
} else if (messageJson.has("en-US")) {
211214
msg = messageJson.get("en-US").getAsString();
212215
}
213216
return msg;

0 commit comments

Comments
 (0)