mirror of
https://github.com/CarmJos/MineConfiguration.git
synced 2026-06-04 13:55:03 +08:00
chore(sound): 添加输入长度判断,适用于不想发送声音的情况。
This commit is contained in:
+1
-1
@@ -85,7 +85,7 @@ public class SoundConfig {
|
|||||||
|
|
||||||
@Contract("null -> null")
|
@Contract("null -> null")
|
||||||
public static @Nullable SoundConfig deserialize(@Nullable String string) throws Exception {
|
public static @Nullable SoundConfig deserialize(@Nullable String string) throws Exception {
|
||||||
if (string == null) return null;
|
if (string == null || string.length() == 0) return null;
|
||||||
|
|
||||||
String[] args = string.contains(":") ? string.split(":") : new String[]{string};
|
String[] args = string.contains(":") ? string.split(":") : new String[]{string};
|
||||||
if (args.length < 1) return null;
|
if (args.length < 1) return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user