Skip to content

Commit

Permalink
load history should not produce NPE, ripme#1853
Browse files Browse the repository at this point in the history
  • Loading branch information
soloturn committed May 9, 2021
1 parent 28cee94 commit d2e248c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/com/rarchives/ripme/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -1183,13 +1183,15 @@ private void loadHistory() {
// Guess rip history based on rip folder
String[] dirs = Utils.getWorkingDirectory()
.list((dir, file) -> new File(dir.getAbsolutePath() + File.separator + file).isDirectory());
for (String dir : dirs) {
String url = RipUtils.urlFromDirectoryName(dir);
if (url != null) {
// We found one, add it to history
HistoryEntry entry = new HistoryEntry();
entry.url = url;
HISTORY.add(entry);
if (dirs != null) {
for (String dir : dirs) {
String url = RipUtils.urlFromDirectoryName(dir);
if (url != null) {
// We found one, add it to history
HistoryEntry entry = new HistoryEntry();
entry.url = url;
HISTORY.add(entry);
}
}
}
}
Expand Down

0 comments on commit d2e248c

Please sign in to comment.