diff options
author | mar-v-in <github@rvin.mooo.com> | 2014-08-14 16:14:16 +0200 |
---|---|---|
committer | mar-v-in <github@rvin.mooo.com> | 2014-08-14 16:14:16 +0200 |
commit | eebd480e8d36bd94227e6c5cd4ac51eef61585ee (patch) | |
tree | 717317cc976e5e88fdb98bebe1d7ddf48f76fb6f /OpenKeychain | |
parent | a6118877ff1b096925c908583985889d30087e24 (diff) | |
download | open-keychain-eebd480e8d36bd94227e6c5cd4ac51eef61585ee.tar.gz open-keychain-eebd480e8d36bd94227e6c5cd4ac51eef61585ee.tar.bz2 open-keychain-eebd480e8d36bd94227e6c5cd4ac51eef61585ee.zip |
Fix KeySpinner on cursor change
Diffstat (limited to 'OpenKeychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java index fe3c61197..380361fc0 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java @@ -133,7 +133,12 @@ public abstract class KeySpinner extends Spinner { @Override public long getItemId(int position) { - return ((Cursor) getItem(position)).getLong(mIndexMasterKeyId); + try { + return ((Cursor) getItem(position)).getLong(mIndexMasterKeyId); + } catch (Exception e) { + // This can happen on concurrent modification :( + return Constants.key.none; + } } }; } |