Skip to content

Commit

Permalink
replace forward slash with underscore in file names when saving psbts
Browse files Browse the repository at this point in the history
  • Loading branch information
craigraw committed Nov 12, 2024
1 parent d731f72 commit 1e0c0c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/com/sparrowwallet/sparrow/AppController.java
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ public void savePSBT(boolean asText, boolean includeXpubs) {

String fileName = ((Label)selectedTab.getGraphic()).getText();
if(fileName != null && !fileName.isEmpty()) {
fileName = fileName.replace('/', '_');
if(!fileName.endsWith(".psbt")) {
fileName += ".psbt";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ public void savePSBT(ActionEvent event) {
fileChooser.setTitle("Save PSBT");

if(headersForm.getName() != null && !headersForm.getName().isEmpty()) {
fileChooser.setInitialFileName(headersForm.getName() + ".psbt");
fileChooser.setInitialFileName(headersForm.getName().replace('/', '_') + ".psbt");
}

AppServices.moveToActiveWindowScreen(window, 800, 450);
Expand Down

0 comments on commit 1e0c0c1

Please sign in to comment.