Fix NPE when ALS is off. (#2715)

This commit is contained in:
吴晟 Wu Sheng 2019-05-19 23:51:17 +08:00 committed by GitHub
parent 9c2f5c9c25
commit 7b21c337e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -18,18 +18,21 @@
package org.apache.skywalking.oap.server.receiver.envoy;
import com.google.common.base.Strings;
import java.util.*;
import java.util.stream.Collectors;
import org.apache.skywalking.oap.server.library.module.ModuleConfig;
/**
* @author wusheng,gaohongtao
* @author wusheng, gaohongtao
*/
public class EnvoyMetricReceiverConfig extends ModuleConfig {
private String alsHTTPAnalysis;
public List<String> getAlsHTTPAnalysis() {
if (Strings.isNullOrEmpty(alsHTTPAnalysis)) {
return Collections.EMPTY_LIST;
}
return Arrays.stream(alsHTTPAnalysis.trim().split(",")).map(String::trim).collect(Collectors.toList());
}
}