2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-22 20:28:00 +00:00

Added null-check for server keys (#106)

Fixes https://github.com/ProxioDev/ValioBungee/issues/105
This commit is contained in:
Efe Kurban 2024-06-17 23:31:28 +03:00 committed by GitHub
parent 3314c5e54b
commit be0c6be2aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -270,7 +270,12 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
responses.put(uuid, pipeline.hget("redis-bungee::" + networkId + "::player::" + uuid + "::data", "server")); responses.put(uuid, pipeline.hget("redis-bungee::" + networkId + "::player::" + uuid + "::data", "server"));
} }
pipeline.sync(); pipeline.sync();
responses.forEach((uuid, response) -> builder.put(response.get(), uuid)); responses.forEach((uuid, response) -> {
String key = response.get();
if (key == null) return;
builder.put(key, uuid);
});
return builder.build(); return builder.build();
} }
@ -281,7 +286,12 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
responses.put(uuid, pipeline.hget("redis-bungee::" + networkId + "::player::" + uuid + "::data", "server")); responses.put(uuid, pipeline.hget("redis-bungee::" + networkId + "::player::" + uuid + "::data", "server"));
} }
pipeline.sync(); pipeline.sync();
responses.forEach((uuid, response) -> builder.put(response.get(), uuid)); responses.forEach((uuid, response) -> {
String key = response.get();
if (key == null) return;
builder.put(key, uuid);
});
return builder.build(); return builder.build();
} }
}.call(); }.call();