mirror of https://github.com/m2049r/xmrwallet.git
catch NPE (#655)
This commit is contained in:
parent
b978396a38
commit
9c921183ab
|
@ -68,15 +68,19 @@ public class ExchangeEditText extends LinearLayout {
|
||||||
}
|
}
|
||||||
boolean ok = true;
|
boolean ok = true;
|
||||||
String nativeAmount = getNativeAmount();
|
String nativeAmount = getNativeAmount();
|
||||||
try {
|
if (nativeAmount == null) {
|
||||||
double amount = Double.parseDouble(nativeAmount);
|
ok = false;
|
||||||
if ((amount < min) || (amount > max)) {
|
} else {
|
||||||
|
try {
|
||||||
|
double amount = Double.parseDouble(nativeAmount);
|
||||||
|
if ((amount < min) || (amount > max)) {
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
// this cannot be
|
||||||
|
Timber.e(ex.getLocalizedMessage());
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException ex) {
|
|
||||||
// this cannot be
|
|
||||||
Timber.e(ex.getLocalizedMessage());
|
|
||||||
ok = false;
|
|
||||||
}
|
}
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
shakeAmountField();
|
shakeAmountField();
|
||||||
|
|
Loading…
Reference in New Issue