Unverified Commit 76e4c599 authored by 吴晟's avatar 吴晟 Committed by GitHub
Browse files

avoid NPE. (#1869)

parent 75e4c679
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -85,22 +85,24 @@ public class ServiceMeshMetricDataDecorator {
            }
        }
        String endpoint = origin.getEndpoint();
        if (destServiceId != Const.NONE) {
            DetectPoint point = origin.getDetectPoint();

        DetectPoint point = origin.getDetectPoint();
        if (DetectPoint.client.equals(point)) {
            if (sourceServiceId != Const.NONE) {
                endpointId = CoreRegisterLinker.getEndpointInventoryRegister().getOrCreate(sourceServiceId, endpoint,
                    org.apache.skywalking.oap.server.core.source.DetectPoint.fromMeshDetectPoint(point));
            }
        } else {
            if (destServiceId != Const.NONE) {
                endpointId = CoreRegisterLinker.getEndpointInventoryRegister().getOrCreate(destServiceId, endpoint,
                    org.apache.skywalking.oap.server.core.source.DetectPoint.fromMeshDetectPoint(point));
            }
        }

        if (endpointId != Const.NONE) {
        } else {
            isRegistered = false;
        }
        }

        return isRegistered;
    }