mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-04-09 04:18:17 +02:00
ensure import file stream is closed
This commit is contained in:
parent
d6c7a0b757
commit
45a9093055
@ -113,8 +113,9 @@ public abstract class FileImportPane extends TitledDescriptionPane {
|
||||
importButton.setDisable(true);
|
||||
setExpanded(true);
|
||||
} else {
|
||||
InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
|
||||
importFile(file.getName(), inputStream, password);
|
||||
try(InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
|
||||
importFile(file.getName(), inputStream, password);
|
||||
};
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Error importing file", e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user