fix sign hash NullPointerException
MODIFY
bither-android/src/net/bither/SignHashActivity.java
bither-android/src/net/bither/SignHashActivity.java
@@ -122,13 +122,15 @@ public class SignHashActivity extends SwipeRightFragmentActivity implements
if (address == null) {
if (isHot) {
hdAccount = AddressManager.getInstance().getHDAccountHot();
- hdAccountAddress = addressForIndex(index, pathType);
- tvAddress.setText(WalletUtils.formatHash(hdAccountAddress.getAddress(), 4, 24));
} else {
hdAccountCold = AddressManager.getInstance().getHDAccountCold();
+ }
hdAccountAddress = addressForIndex(index, pathType);
- tvAddress.setText(WalletUtils.formatHash(hdAccountAddress.getAddress(), 4, 24));
+ if (hdAccountAddress == null) {
+ finish();
+ return;
}
+ tvAddress.setText(WalletUtils.formatHash(hdAccountAddress.getAddress(), 4, 24));
ivQr.setContent(hdAccountAddress.getAddress(), theme.getFgColor(), theme.getBgColor());
} else {
tvAddress.setText(WalletUtils.formatHash(address.getAddress(), 4, 24));

MODIFY
bither-android/src/net/bither/SignMessageActivity.java
bither-android/src/net/bither/SignMessageActivity.java
@@ -122,13 +122,15 @@ public class SignMessageActivity extends SwipeRightFragmentActivity implements
if (address == null) {
if (isHot) {
hdAccount = AddressManager.getInstance().getHDAccountHot();
- hdAccountAddress = addressForIndex(index, pathType);
- tvAddress.setText(WalletUtils.formatHash(hdAccountAddress.getAddress(), 4, 12));
} else {
hdAccountCold = AddressManager.getInstance().getHDAccountCold();
+ }
hdAccountAddress = addressForIndex(index, pathType);
- tvAddress.setText(WalletUtils.formatHash(hdAccountAddress.getAddress(), 4, 12));
+ if (hdAccountAddress == null) {
+ finish();
+ return;
}
+ tvAddress.setText(WalletUtils.formatHash(hdAccountAddress.getAddress(), 4, 12));
ivQr.setContent(hdAccountAddress.getAddress(), theme.getFgColor(), theme.getBgColor());
} else {
tvAddress.setText(WalletUtils.formatHash(address.getAddress(), 4, 12));

fix sign hash NullPointerException