mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 03:16:41 +00:00
Update PropertiesConfiguration. Catch potential NPE.
This commit is contained in:
@ -18,7 +18,6 @@
|
||||
*/
|
||||
package com.sk89q.worldedit.snapshots;
|
||||
|
||||
import com.sk89q.worldedit.data.MissingWorldException;
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.util.ArrayList;
|
||||
@ -26,6 +25,8 @@ import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.sk89q.worldedit.data.MissingWorldException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author sk89q
|
||||
@ -73,6 +74,7 @@ public class SnapshotRepository {
|
||||
*/
|
||||
public List<Snapshot> getSnapshots(boolean newestFirst, String worldname) throws MissingWorldException {
|
||||
FilenameFilter filter = new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
File f = new File(dir, name);
|
||||
return isValidSnapshot(f);
|
||||
@ -80,6 +82,9 @@ public class SnapshotRepository {
|
||||
};
|
||||
|
||||
File[] snapshotFiles = dir.listFiles();
|
||||
if (snapshotFiles == null) {
|
||||
throw new MissingWorldException(worldname);
|
||||
}
|
||||
List<Snapshot> list = new ArrayList<Snapshot>(snapshotFiles.length);
|
||||
|
||||
for (File file : snapshotFiles) {
|
||||
|
Reference in New Issue
Block a user