check args.length before indexing
This commit is contained in:
parent
77d014b24c
commit
a8ab98e6cb
|
@ -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) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue