mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix NPE when using //schem list with not schematics present.
This commit is contained in:
parent
6c03eea9b1
commit
94ae1be2d1
@ -262,14 +262,15 @@ public class SchematicCommands {
|
|||||||
public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException {
|
public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException {
|
||||||
File dir = worldEdit.getWorkingDirectoryFile(worldEdit.getConfiguration().saveDir);
|
File dir = worldEdit.getWorkingDirectoryFile(worldEdit.getConfiguration().saveDir);
|
||||||
List<File> fileList = allFiles(dir);
|
List<File> fileList = allFiles(dir);
|
||||||
File[] files = new File[fileList.size()];
|
|
||||||
fileList.toArray(files);
|
|
||||||
|
|
||||||
if (files.length == 0) {
|
if (fileList.isEmpty()) {
|
||||||
actor.printError("No schematics found.");
|
actor.printError("No schematics found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File[] files = new File[fileList.size()];
|
||||||
|
fileList.toArray(files);
|
||||||
|
|
||||||
int pageCount = files.length / SCHEMATICS_PER_PAGE + 1;
|
int pageCount = files.length / SCHEMATICS_PER_PAGE + 1;
|
||||||
if (page < 1) {
|
if (page < 1) {
|
||||||
actor.printError("Page must be at least 1");
|
actor.printError("Page must be at least 1");
|
||||||
|
Loading…
Reference in New Issue
Block a user