From 31f138dd0b686ecc10dbbbc6777884fe7ed29ed2 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 24 Jul 2005 05:01:08 +0000 Subject: [PATCH] handle time == 0 --- bindings/java/src/net/hyperic/sigar/cmd/Who.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Who.java b/bindings/java/src/net/hyperic/sigar/cmd/Who.java index 4718c6ff..b05e17b5 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Who.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Who.java @@ -20,6 +20,9 @@ public class Who extends SigarCommandBase { } private String getTime(long time) { + if (time == 0) { + return "unknown"; + } String fmt = "MMM dd HH:mm"; return new SimpleDateFormat(fmt).format(new Date(time)); }