SteamWar/SpigotCore
Archiviert
13
0

Fix SWCommandUtils.numberMapper
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2021-12-13 11:59:20 +01:00
Ursprung 611bc58576
Commit 74866de040

Datei anzeigen

@ -260,11 +260,14 @@ public class SWCommandUtils {
private static <T> Function<String, T> numberMapper(Function<String, T> mapper) { private static <T> Function<String, T> numberMapper(Function<String, T> mapper) {
return s -> { return s -> {
if (s.equalsIgnoreCase("nan")) return null;
try { try {
if (s.equalsIgnoreCase("nan")) {
return null;
}
return mapper.apply(s); return mapper.apply(s);
} catch (NumberFormatException e) {
// Ignored
}
try {
return mapper.apply(s.replace(',', '.'));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return null; return null;
} }