From 9afd3392ed1e604187cce7ba6e4341e182f24fc0 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 9 May 2005 23:32:40 +0000 Subject: [PATCH] check for null line --- bindings/java/src/net/hyperic/sigar/util/Getline.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/net/hyperic/sigar/util/Getline.java b/bindings/java/src/net/hyperic/sigar/util/Getline.java index 414fd3dd..b5b1e771 100644 --- a/bindings/java/src/net/hyperic/sigar/util/Getline.java +++ b/bindings/java/src/net/hyperic/sigar/util/Getline.java @@ -52,7 +52,7 @@ public class Getline { //XXX provide pure-java fallback String line = getline(prompt); if (addToHistory) { - histadd(line); + addToHistory(line); } return line; } @@ -64,6 +64,11 @@ public class Getline { } public void addToHistory(String line) { + if ((line == null) || + (line.length() == 0)) + { + return; + } histadd(line); } }