mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
Wallet: use getAbsoluteFile()
when checking if parent directory exists
This fixes a NPE when using wallet-tool to create a new wallet on a path without directory, e.g. `wallet-tool create --wallet=test.wallet`.
This commit is contained in:
parent
8aa808f7d4
commit
110da96911
1 changed files with 2 additions and 2 deletions
|
@ -1700,11 +1700,11 @@ public class Wallet extends BaseTaggableObject
|
|||
* @throws IOException if an error occurs while saving
|
||||
*/
|
||||
public void saveToFile(File tempFile, File destFile) throws IOException {
|
||||
File tempParentFile = tempFile.getParentFile();
|
||||
File tempParentFile = tempFile.getAbsoluteFile().getParentFile();
|
||||
if (!tempParentFile.exists()) {
|
||||
throw new FileNotFoundException(tempParentFile.getPath() + " (wallet directory not found)");
|
||||
}
|
||||
File destParentFile = destFile.getParentFile();
|
||||
File destParentFile = destFile.getAbsoluteFile().getParentFile();
|
||||
if (!destParentFile.exists()) {
|
||||
throw new FileNotFoundException(destParentFile.getPath() + " (wallet directory not found)");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue