|
|
@@ -276,15 +276,17 @@ public class GPGUtil {
|
|
|
passwordGetter.SetStep(FileInterfaceFactory.ChangePasswordGetter.eStep.eNewPassword).GetPassword(new GitInterface.OnResponseListener<String>() {
|
|
|
@Override
|
|
|
public void onResponse(String result) {
|
|
|
- try {
|
|
|
- ArrayList<PGPSecretKeyRing> keyringCollection = new ArrayList<>();
|
|
|
- keyringCollection.add(DoChangePassword(secretKey, sKey, result));
|
|
|
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
|
|
- new PGPSecretKeyRingCollection(keyringCollection).encode(stream);
|
|
|
- SettingsManager.SetGPGKeyContent(ctx, SettingsManager.GPG_GENERATED, new ByteArrayInputStream(stream.toByteArray()));
|
|
|
- onDone.run();
|
|
|
- } catch (PGPException | IOException e) {
|
|
|
- onError(e.getMessage(), e);
|
|
|
+ if (result != null) {
|
|
|
+ try {
|
|
|
+ ArrayList<PGPSecretKeyRing> keyringCollection = new ArrayList<>();
|
|
|
+ keyringCollection.add(DoChangePassword(secretKey, sKey, result));
|
|
|
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
|
|
+ new PGPSecretKeyRingCollection(keyringCollection).encode(stream);
|
|
|
+ SettingsManager.SetGPGKeyContent(ctx, SettingsManager.GPG_GENERATED, new ByteArrayInputStream(stream.toByteArray()));
|
|
|
+ onDone.run();
|
|
|
+ } catch (PGPException | IOException e) {
|
|
|
+ onError(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|