mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
Wallet: extract local variables tempParentFile
and destParentFile
in method saveToFile()
This is meant to make it a bit clearer why a NullPointerException would occur.
This commit is contained in:
parent
87a2892bca
commit
5c5b2969d7
1 changed files with 6 additions and 4 deletions
|
@ -1692,11 +1692,13 @@ public class Wallet extends BaseTaggableObject
|
|||
* @throws IOException if an error occurs while saving
|
||||
*/
|
||||
public void saveToFile(File tempFile, File destFile) throws IOException {
|
||||
if (!tempFile.getParentFile().exists()) {
|
||||
throw new FileNotFoundException(tempFile.getParentFile().getPath() + " (wallet directory not found)");
|
||||
File tempParentFile = tempFile.getParentFile();
|
||||
if (!tempParentFile.exists()) {
|
||||
throw new FileNotFoundException(tempParentFile.getPath() + " (wallet directory not found)");
|
||||
}
|
||||
if (!destFile.getParentFile().exists()) {
|
||||
throw new FileNotFoundException(destFile.getParentFile().getPath() + " (wallet directory not found)");
|
||||
File destParentFile = destFile.getParentFile();
|
||||
if (!destParentFile.exists()) {
|
||||
throw new FileNotFoundException(destParentFile.getPath() + " (wallet directory not found)");
|
||||
}
|
||||
FileOutputStream stream = null;
|
||||
lock.lock();
|
||||
|
|
Loading…
Add table
Reference in a new issue