aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain
diff options
context:
space:
mode:
authormar-v-in <github@rvin.mooo.com>2014-08-14 16:14:16 +0200
committermar-v-in <github@rvin.mooo.com>2014-08-14 16:14:16 +0200
commiteebd480e8d36bd94227e6c5cd4ac51eef61585ee (patch)
tree717317cc976e5e88fdb98bebe1d7ddf48f76fb6f /OpenKeychain
parenta6118877ff1b096925c908583985889d30087e24 (diff)
downloadopen-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.java7
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;
+ }
}
};
}