mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +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
|
@Override
|
||||||
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
||||||
if (node == null && file.exists()) {
|
if (node == null) {
|
||||||
file.delete();
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +58,10 @@ public class JsonDao extends ConfigurateDao {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
||||||
if (node == null && file.exists()) {
|
if (node == null) {
|
||||||
file.delete();
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,8 +60,10 @@ public class YamlDao extends ConfigurateDao {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
protected void saveFile(File file, ConfigurationNode node) throws IOException {
|
||||||
if (node == null && file.exists()) {
|
if (node == null) {
|
||||||
file.delete();
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user