Fixed a NPE in WorldEdit.getSafeFile() when extensions is null.

This commit is contained in:
zml2008
2011-12-26 16:28:51 -08:00
parent cc256aa246
commit 76fd63d64b
2 changed files with 2 additions and 48 deletions

View File

@ -718,7 +718,7 @@ public class WorldEdit {
private File getSafeFile(LocalPlayer player, File dir, String filename,
String defaultExt, String[] extensions, boolean isSave)
throws FilenameException {
if (extensions.length == 1 && extensions[0] == null) extensions = null;
if (extensions != null && (extensions.length == 1 && extensions[0] == null)) extensions = null;
File f;
@ -1258,6 +1258,7 @@ public class WorldEdit {
} catch (WrappedCommandException e) {
throw e.getCause();
} catch (UnhandledCommandException e) {
player.printError("Command could not be handled; invalid sender!");
return false;
} finally {
session.remember(editSession);