1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-27 15:49:50 +02:00

[Bugfix] Handle a resource with a proper Try with Resources.

Trim the line input to avoid problems with whitespace on each line.
This commit is contained in:
Brian Wiegand
2019-01-12 21:15:04 -08:00
parent fc2e9c42fa
commit 0db4cd22d0

View File

@@ -872,9 +872,9 @@ public final class MainWindow implements Runnable, RipStatusHandler {
LOGGER.error("Error while getting selected path: ", e); LOGGER.error("Error while getting selected path: ", e);
return; return;
} }
try { try (BufferedReader br = new BufferedReader(new FileReader(chosenPath))) {
BufferedReader br = new BufferedReader(new FileReader(chosenPath));
for (String line = br.readLine(); line != null; line = br.readLine()) { for (String line = br.readLine(); line != null; line = br.readLine()) {
line = line.trim();
if (line.startsWith("http")) { if (line.startsWith("http")) {
MainWindow.addUrlToQueue(line); MainWindow.addUrlToQueue(line);
} else { } else {