You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2018/11/02 06:27:08 UTC

[incubator-skywalking] branch fix-mesh created (now 0970bef)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch fix-mesh
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git.


      at 0970bef  avoid NPE.

This branch includes the following new commits:

     new 0970bef  avoid NPE.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-skywalking] 01/01: avoid NPE.

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch fix-mesh
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit 0970beff0094681e1811cb9b76160f8e23d68b6f
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Fri Nov 2 14:26:56 2018 +0800

    avoid NPE.
---
 .../receiver/mesh/ServiceMeshMetricDataDecorator.java  | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/ServiceMeshMetricDataDecorator.java b/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/ServiceMeshMetricDataDecorator.java
index 3dae80d..8e8a87b 100644
--- a/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/ServiceMeshMetricDataDecorator.java
+++ b/oap-server/server-receiver-plugin/skywalking-mesh-receiver-plugin/src/main/java/org/apache/skywalking/aop/server/receiver/mesh/ServiceMeshMetricDataDecorator.java
@@ -85,21 +85,23 @@ public class ServiceMeshMetricDataDecorator {
             }
         }
         String endpoint = origin.getEndpoint();
-        if (destServiceId != Const.NONE) {
-            DetectPoint point = origin.getDetectPoint();
 
-            if (DetectPoint.client.equals(point)) {
+        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 {
+            }
+        } 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;
-            }
+        if (endpointId != Const.NONE) {
+        } else {
+            isRegistered = false;
         }
 
         return isRegistered;