mirror of https://github.com/m2049r/xmrwallet.git
deal with illegal values for device type (#434)
This commit is contained in:
parent
3cf84c599d
commit
8c01ec36e8
|
@ -183,7 +183,11 @@ public class WalletManager {
|
|||
|
||||
public Wallet.Device queryWalletDevice(String keys_file_name, String password) {
|
||||
int device = queryWalletDeviceJ(keys_file_name, password);
|
||||
return Wallet.Device.values()[device + 1]; // mapping is monero+1=android
|
||||
Wallet.Device[] types = Wallet.Device.values();
|
||||
// mapping is monero+1=android
|
||||
if ((device < 0) || (device > types.length - 2))
|
||||
device = -1;
|
||||
return types[device + 1];
|
||||
}
|
||||
|
||||
private native int queryWalletDeviceJ(String keys_file_name, String password);
|
||||
|
|
Loading…
Reference in New Issue