diff --git a/config.sh b/config.sh index bdd7f46..a4bf0f9 100755 --- a/config.sh +++ b/config.sh @@ -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 \ No newline at end of file +export GITHUB_TAG=0.0.33 \ No newline at end of file diff --git a/src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java b/src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java index 7b81c40..48dc3f6 100644 --- a/src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java +++ b/src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java @@ -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) {