fix ArthasAgent NullPointerException. #1546

pull/1551/head
hengyunabc 4 years ago
parent 5e73f49abd
commit a2b45c45b8

@ -45,7 +45,10 @@ public class ArthasAgent {
public ArthasAgent(Map<String, String> configMap, String arthasHome, boolean slientInit,
Instrumentation instrumentation) {
this.configMap = configMap;
if (configMap != null) {
this.configMap = configMap;
}
this.arthasHome = arthasHome;
this.slientInit = slientInit;
this.instrumentation = instrumentation;

@ -189,7 +189,10 @@ public class ArthasBootstrap {
* https://github.com/alibaba/arthas/issues/986
* </pre>
*/
Map<String, String> copyMap = new HashMap<String, String>(argsMap);
Map<String, String> copyMap = new HashMap<String, String>();
if (argsMap != null) {
copyMap.putAll(argsMap);
}
// 添加 arthas.home
if (!copyMap.containsKey(ARTHAS_HOME_PROPERTY)) {
copyMap.put(ARTHAS_HOME_PROPERTY, arthasHome());

Loading…
Cancel
Save