fix unclosed scanner

Former-commit-id: b9c0fc5e38
Former-commit-id: 048eebdff9f3f24f2701c8cceb75b410adcc3b76
This commit is contained in:
idk
2022-09-07 04:34:36 -04:00
parent 13f54f2769
commit 3f877ebac2
2 changed files with 10 additions and 9 deletions

View File

@ -1,6 +1,6 @@
#! /usr/bin/env sh
export GITHUB_USER=eyedeekay
export GITHUB_REPO=i2p.plugins.firefox
export GITHUB_NAME="Fix URL argument passing"
export GITHUB_NAME="Fix unclosed scanner"
export GITHUB_DESCRIPTION=$(cat CHANGES.md)
export GITHUB_TAG=0.0.32
export GITHUB_TAG=0.0.33

View File

@ -118,13 +118,14 @@ public class I2PFirefoxProfileChecker extends I2PCommonBrowser {
String newString =
"\"browser.startup.homepage\", \"http://127.0.0.1:7657\"";
try {
Scanner scanner = new Scanner(file);
// now read the file line by line...
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (line.contains("browser.startup.homepage")) {
oldString = line.toString();
return undoValue(oldString, newString, fileToBeModified);
try (Scanner scanner = new Scanner(file)) {
// now read the file line by line...
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (line.contains("browser.startup.homepage")) {
oldString = line.toString();
return undoValue(oldString, newString, fileToBeModified);
}
}
}
} catch (FileNotFoundException e) {