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:
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user