Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Close locale streams (#1832)
* Close locale streams * Fix formatting
Dieser Commit ist enthalten in:
Ursprung
af405f320a
Commit
dd0b4bafe8
@ -217,8 +217,8 @@ public class FileUtils {
|
|||||||
* @return The byte array of the file
|
* @return The byte array of the file
|
||||||
*/
|
*/
|
||||||
public static byte[] readAllBytes(File file) {
|
public static byte[] readAllBytes(File file) {
|
||||||
try {
|
try (InputStream inputStream = new FileInputStream(file)) {
|
||||||
return readAllBytes(new FileInputStream(file));
|
return readAllBytes(inputStream);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("Cannot read " + file);
|
throw new RuntimeException("Cannot read " + file);
|
||||||
}
|
}
|
||||||
|
@ -208,6 +208,12 @@ public class LocaleUtils {
|
|||||||
|
|
||||||
// Insert the locale into the mappings
|
// Insert the locale into the mappings
|
||||||
LOCALE_MAPPINGS.put(locale.toLowerCase(), langMap);
|
LOCALE_MAPPINGS.put(locale.toLowerCase(), langMap);
|
||||||
|
|
||||||
|
try {
|
||||||
|
localeStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new AssertionError(LanguageUtils.getLocaleStringLog("geyser.locale.fail.file", locale, e.getMessage()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
GeyserConnector.getInstance().getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.locale.fail.missing", locale));
|
GeyserConnector.getInstance().getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.locale.fail.missing", locale));
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren