aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-09-23 17:42:42 -0700
committerKenny Root <kenny@the-b.org>2015-09-23 17:47:01 -0700
commit057843e78e2af41909049b9245c834509eecd1aa (patch)
tree6aa80169e015a286dd49cee0446b057fbb3c1cfb
parente169dd914f99c4a0253b578c044f8d17714210e7 (diff)
downloadconnectbot-057843e78e2af41909049b9245c834509eecd1aa.tar.gz
connectbot-057843e78e2af41909049b9245c834509eecd1aa.tar.bz2
connectbot-057843e78e2af41909049b9245c834509eecd1aa.zip
Only use pubkey if it is not null
Since we null check the pubkey, we should make sure not to dereference it later on.
-rw-r--r--app/src/main/java/org/connectbot/PubkeyListActivity.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/src/main/java/org/connectbot/PubkeyListActivity.java b/app/src/main/java/org/connectbot/PubkeyListActivity.java
index d25411f..9f8521f 100644
--- a/app/src/main/java/org/connectbot/PubkeyListActivity.java
+++ b/app/src/main/java/org/connectbot/PubkeyListActivity.java
@@ -629,16 +629,15 @@ public class PubkeyListActivity extends AppCompatListActivity implements EventLi
PubkeyViewHolder pubkeyHolder = (PubkeyViewHolder) holder;
PubkeyBean pubkey = pubkeys.get(position);
+ pubkeyHolder.pubkey = pubkey;
if (pubkey == null) {
// Well, something bad happened. We can't continue.
Log.e("PubkeyAdapter", "Pubkey bean is null!");
pubkeyHolder.nickname.setText("Error during lookup");
- pubkeyHolder.caption.setText("see 'adb logcat' for more");
+ } else {
+ pubkeyHolder.nickname.setText(pubkey.getNickname());
}
- pubkeyHolder.pubkey = pubkey;
-
- pubkeyHolder.nickname.setText(pubkey.getNickname());
boolean imported = PubkeyDatabase.KEY_TYPE_IMPORTED.equals(pubkey.getType());