Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-25 15:50:14 +01:00
Handle a string possibly being null (#2638)
An NPE can be thrown if message is null and `message.isBlank()` is called.
Dieser Commit ist enthalten in:
Ursprung
581c24f2e9
Commit
b92b49b5e4
@ -147,6 +147,9 @@ public class MessageTranslator {
|
|||||||
* @return Bedrock formatted message
|
* @return Bedrock formatted message
|
||||||
*/
|
*/
|
||||||
public static String convertMessageLenient(String message, String locale) {
|
public static String convertMessageLenient(String message, String locale) {
|
||||||
|
if (message == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
if (message.isBlank()) {
|
if (message.isBlank()) {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren