check args.length before indexing

This commit is contained in:
Doug MacEachern 2004-08-25 17:06:21 +00:00
parent 77d014b24c
commit a8ab98e6cb
1 changed files with 3 additions and 1 deletions

View File

@ -151,7 +151,9 @@ public class Ps extends SigarCommandBase {
else { else {
try { try {
String[] args = sigar.getProcArgs(pid); String[] args = sigar.getProcArgs(pid);
name = args[0]; if (args.length != 0) {
name = args[0];
}
} catch (SigarException e) {} } catch (SigarException e) {}
} }