mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-23 22:14:06 +02:00
load history should not produce NPE, ripme#1853
see: * https://github.com/RipMeApp/ripme/issues/1853 * https://stackoverflow.com/questions/20714058/file-exists-and-is-directory-but-listfiles-returns-null
This commit is contained in:
@@ -1183,6 +1183,7 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
||||
// Guess rip history based on rip folder
|
||||
String[] dirs = Utils.getWorkingDirectory()
|
||||
.list((dir, file) -> new File(dir.getAbsolutePath() + File.separator + file).isDirectory());
|
||||
if (dirs != null) {
|
||||
for (String dir : dirs) {
|
||||
String url = RipUtils.urlFromDirectoryName(dir);
|
||||
if (url != null) {
|
||||
@@ -1195,6 +1196,7 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveHistory() {
|
||||
Path historyFile = Paths.get(Utils.getConfigDir() + File.separator + "history.json");
|
||||
|
Reference in New Issue
Block a user