mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-02-22 07:03:35 +01: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:
parent
28cee940b0
commit
d2e248cb61
@ -1183,13 +1183,15 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
// Guess rip history based on rip folder
|
// Guess rip history based on rip folder
|
||||||
String[] dirs = Utils.getWorkingDirectory()
|
String[] dirs = Utils.getWorkingDirectory()
|
||||||
.list((dir, file) -> new File(dir.getAbsolutePath() + File.separator + file).isDirectory());
|
.list((dir, file) -> new File(dir.getAbsolutePath() + File.separator + file).isDirectory());
|
||||||
for (String dir : dirs) {
|
if (dirs != null) {
|
||||||
String url = RipUtils.urlFromDirectoryName(dir);
|
for (String dir : dirs) {
|
||||||
if (url != null) {
|
String url = RipUtils.urlFromDirectoryName(dir);
|
||||||
// We found one, add it to history
|
if (url != null) {
|
||||||
HistoryEntry entry = new HistoryEntry();
|
// We found one, add it to history
|
||||||
entry.url = url;
|
HistoryEntry entry = new HistoryEntry();
|
||||||
HISTORY.add(entry);
|
entry.url = url;
|
||||||
|
HISTORY.add(entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user