diff options
author | Kenny Root <kenny@the-b.org> | 2010-10-08 00:39:57 -0500 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2010-10-08 00:39:57 -0500 |
commit | e43f63aa4ade3a58318458174a46d4e6f5e8b81e (patch) | |
tree | 4a33f19ddf012d2ec1521fcaf979c35bc75c816f /src | |
parent | 19fbcefef5251cdfac970365c5ddb58e7d7f46a6 (diff) | |
download | connectbot-e43f63aa4ade3a58318458174a46d4e6f5e8b81e.tar.gz connectbot-e43f63aa4ade3a58318458174a46d4e6f5e8b81e.tar.bz2 connectbot-e43f63aa4ade3a58318458174a46d4e6f5e8b81e.zip |
Support adding port forwards on host not in DB
Diffstat (limited to 'src')
-rw-r--r-- | src/org/connectbot/PortForwardListActivity.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/connectbot/PortForwardListActivity.java b/src/org/connectbot/PortForwardListActivity.java index e5c6d21..f9982e4 100644 --- a/src/org/connectbot/PortForwardListActivity.java +++ b/src/org/connectbot/PortForwardListActivity.java @@ -113,7 +113,7 @@ public class PortForwardListActivity extends ListActivity { host = hostdb.findHostById(hostId); { - String nickname = host.getNickname(); + final String nickname = host != null ? host.getNickname() : null; final Resources resources = getResources(); if (nickname != null) { @@ -209,7 +209,8 @@ public class PortForwardListActivity extends ListActivity { break; } - PortForwardBean pfb = new PortForwardBean(host.getId(), + PortForwardBean pfb = new PortForwardBean( + host != null ? host.getId() : -1, nicknameEdit.getText().toString(), type, sourcePortEdit.getText().toString(), destEdit.getText().toString()); @@ -219,7 +220,7 @@ public class PortForwardListActivity extends ListActivity { hostBridge.enablePortForward(pfb); } - if (!hostdb.savePortForward(pfb)) + if (host != null && !hostdb.savePortForward(pfb)) throw new SQLException("Could not save port forward"); updateHandler.sendEmptyMessage(-1); |