From 1e0c0c1c7519ed3d812410ee55ed7ebd32b2fd72 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 12 Nov 2024 08:48:50 +0200 Subject: [PATCH] replace forward slash with underscore in file names when saving psbts --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 1 + .../sparrowwallet/sparrow/transaction/HeadersController.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index f0a200e4..ff994846 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -798,6 +798,7 @@ public class AppController implements Initializable { String fileName = ((Label)selectedTab.getGraphic()).getText(); if(fileName != null && !fileName.isEmpty()) { + fileName = fileName.replace('/', '_'); if(!fileName.endsWith(".psbt")) { fileName += ".psbt"; } diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index cb3bed45..b7ec2b7f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -993,7 +993,7 @@ public class HeadersController extends TransactionFormController implements Init 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);