From 466fa406a1145dec09b587e282447f2fdcb61ae6 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Mon, 2 Dec 2019 20:19:09 +0800 Subject: [PATCH] fix profiler execute make jvm crash problem. close #962 --- .../arthas/core/command/monitor200/ProfilerCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java index 60aa4e0d..fd14bb5a 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java @@ -266,6 +266,11 @@ public class ProfilerCommand extends AnnotatedCommand { AsyncProfiler asyncProfiler = this.profilerInstance(); if (ProfilerAction.execute.equals(profilerAction)) { + if (actionArg == null) { + process.write("actionArg can not be empty.\n"); + status = 1; + return; + } String result = execute(asyncProfiler, this.actionArg); process.write(result); } else if (ProfilerAction.start.equals(profilerAction)) {