mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
ensure import file stream is closed
This commit is contained in:
parent
d6c7a0b757
commit
45a9093055
1 changed files with 3 additions and 2 deletions
|
@ -113,8 +113,9 @@ public abstract class FileImportPane extends TitledDescriptionPane {
|
||||||
importButton.setDisable(true);
|
importButton.setDisable(true);
|
||||||
setExpanded(true);
|
setExpanded(true);
|
||||||
} else {
|
} else {
|
||||||
InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
|
try(InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
|
||||||
importFile(file.getName(), inputStream, password);
|
importFile(file.getName(), inputStream, password);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error importing file", e);
|
log.error("Error importing file", e);
|
||||||
|
|
Loading…
Reference in a new issue