File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/me/rothes/protocolstringreplacer Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments