Prevent possible NPE in SshUtil

Change-Id: I683c33c8c9f655c9fd8f2091b0c6f0483e362e71
This commit is contained in:
David Pursehouse
2013-08-23 18:30:02 +09:00
parent 4e712fda34
commit faf1c4e2ee

View File

@@ -79,7 +79,7 @@ public class SshUtil {
final StringBuilder strBuf = new StringBuilder();
final BufferedReader br = new BufferedReader(new StringReader(keyStr));
String line = br.readLine(); // BEGIN SSH2 line...
if (!line.equals("---- BEGIN SSH2 PUBLIC KEY ----")) {
if (line == null || !line.equals("---- BEGIN SSH2 PUBLIC KEY ----")) {
return keyStr;
}