From 07eb0963cae3a403f8774f65afa20c940ce7124f Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 13 Jun 2014 08:57:41 -0400
Subject: [PATCH] Merged #103 "flotr2 throws exception on small dashboards"

---
 src/main/java/com/gitblit/transport/ssh/keys/BaseKeyCommand.java |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/gitblit/transport/ssh/keys/BaseKeyCommand.java b/src/main/java/com/gitblit/transport/ssh/keys/BaseKeyCommand.java
index 588770f..4b1d6b8 100644
--- a/src/main/java/com/gitblit/transport/ssh/keys/BaseKeyCommand.java
+++ b/src/main/java/com/gitblit/transport/ssh/keys/BaseKeyCommand.java
@@ -37,17 +37,20 @@
 			throws UnsupportedEncodingException, IOException {
 		int idx = -1;
 		if (sshKeys.isEmpty() || (idx = sshKeys.indexOf("-")) >= 0) {
-			String sshKey = "";
+			String content = "";
 			BufferedReader br = new BufferedReader(new InputStreamReader(
 					in, Charsets.UTF_8));
 			String line;
 			while ((line = br.readLine()) != null) {
-				sshKey += line + "\n";
+				content += line + "\n";
 			}
-			if (idx == -1) {
-				sshKeys.add(sshKey.trim());
-			} else {
-				sshKeys.set(idx, sshKey.trim());
+			final String sshKey = content.trim();
+			if (!sshKey.isEmpty()) {
+				if (idx == -1) {
+					sshKeys.add(sshKey);
+				} else {
+					sshKeys.set(idx, sshKey);
+				}
 			}
 		}
 		return sshKeys;

--
Gitblit v1.9.1