Fix clr receiver (#2456)

This commit is contained in:
Lemon 2019-04-07 23:25:08 +08:00 committed by GitHub
parent 8dbd19f329
commit c3cc3d2e56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@
package org.apache.skywalking.oap.server.receiver.clr.provider.handler;
import java.util.Objects;
import org.apache.skywalking.apm.network.common.CPU;
import org.apache.skywalking.apm.network.language.agent.CLRMetric;
import org.apache.skywalking.apm.network.language.agent.ClrGC;
@ -51,7 +52,7 @@ public class CLRSourceDispatcher {
void sendMetric(int serviceInstanceId, long minuteTimeBucket, CLRMetric metric) {
ServiceInstanceInventory serviceInstanceInventory = instanceInventoryCache.get(serviceInstanceId);
int serviceId;
if (serviceInstanceInventory == null) {
if (Objects.nonNull(serviceInstanceInventory)) {
serviceId = serviceInstanceInventory.getServiceId();
} else {
logger.warn("Can't found service by service instance id from cache, service instance id is: {}", serviceInstanceId);