mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-25 20:16:14 +01:00
Fixed file backup npe.
This commit is contained in:
parent
11fa9e5ee8
commit
0d3e56f6b6
@ -6,19 +6,9 @@ import com.songoda.epicheads.utils.storage.StorageItem;
|
||||
import com.songoda.epicheads.utils.storage.StorageRow;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.MemorySection;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class StorageYaml extends Storage {
|
||||
|
||||
@ -118,7 +108,8 @@ public class StorageYaml extends Storage {
|
||||
File data = new File(instance.getDataFolder(), "data.yml");
|
||||
File dataClone = new File(instance.getDataFolder(), "data-backup-" + System.currentTimeMillis() + ".yml");
|
||||
try {
|
||||
copyFile(data, dataClone);
|
||||
if (data.exists())
|
||||
copyFile(data, dataClone);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user