Add nullcheck at seed restore

This commit is contained in:
Manfred Karrer 2018-01-03 17:52:32 +01:00
parent c15dda697a
commit dbdb8b3cea
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
2 changed files with 6 additions and 2 deletions

View File

@ -226,7 +226,9 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
}
private void doRestore() {
long date = restoreDatePicker.getValue().atStartOfDay().toEpochSecond(ZoneOffset.UTC);
final LocalDate value = restoreDatePicker.getValue();
//TODO Is ZoneOffset correct?
long date = value != null ? value.atStartOfDay().toEpochSecond(ZoneOffset.UTC) : 0;
DeterministicSeed seed = new DeterministicSeed(Splitter.on(" ").splitToList(seedWordsTextArea.getText()), null, "", date);
walletsManager.restoreSeedWords(
seed,

View File

@ -340,7 +340,9 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
}
private void doRestore() {
long date = datePicker.getValue().atStartOfDay().toEpochSecond(ZoneOffset.UTC);
final LocalDate value = datePicker.getValue();
//TODO Is ZoneOffset correct?
long date = value != null ? value.atStartOfDay().toEpochSecond(ZoneOffset.UTC) : 0;
DeterministicSeed seed = new DeterministicSeed(Splitter.on(" ").splitToList(seedWordsTextArea.getText()), null, "", date);
walletsManager.restoreSeedWords(
seed,