Fixed NPE when trying to open a downloaded file with an empty replay_recordings folder
This commit is contained in:
@@ -50,7 +50,9 @@ public class GuiReplayInstanceChooser extends GuiScreen {
|
|||||||
|
|
||||||
List<File> chooseableFiles = new ArrayList<File>();
|
List<File> chooseableFiles = new ArrayList<File>();
|
||||||
|
|
||||||
for(File file : replayFolder.listFiles()) {
|
File[] files = replayFolder.listFiles();
|
||||||
|
if(files != null) {
|
||||||
|
for(File file : files) {
|
||||||
try {
|
try {
|
||||||
String extension = FilenameUtils.getExtension(file.getAbsolutePath());
|
String extension = FilenameUtils.getExtension(file.getAbsolutePath());
|
||||||
if(!("." + extension).equals(ReplayFile.ZIP_FILE_EXTENSION)) continue;
|
if(!("." + extension).equals(ReplayFile.ZIP_FILE_EXTENSION)) continue;
|
||||||
@@ -66,6 +68,7 @@ public class GuiReplayInstanceChooser extends GuiScreen {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//if no modified versions of the replay were found, start the downloaded one
|
//if no modified versions of the replay were found, start the downloaded one
|
||||||
if(chooseableFiles.isEmpty()) {
|
if(chooseableFiles.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user