mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Fix race condition when saving null config nodes to non-existent files
This commit is contained in:
parent
a7cb7ec1af
commit
d992d7f77c
@ -57,8 +57,10 @@ public class HoconDao extends ConfigurateDao {
|
||||
|
||||
@Override
|
||||
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
||||
if (node == null && file.exists()) {
|
||||
if (node == null) {
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,10 @@ public class JsonDao extends ConfigurateDao {
|
||||
|
||||
@Override
|
||||
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
||||
if (node == null && file.exists()) {
|
||||
if (node == null) {
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,10 @@ public class YamlDao extends ConfigurateDao {
|
||||
|
||||
@Override
|
||||
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
||||
if (node == null && file.exists()) {
|
||||
if (node == null) {
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user