You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ta...@apache.org on 2019/12/17 13:07:18 UTC

[skywalking] 01/01: fix NPE.

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

tanjian pushed a commit to branch instance_inventory_node_type
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 05d50da2b6a797d861b2982dfdd4b11095bda2b8
Author: JaredTan95 <ji...@daocloud.io>
AuthorDate: Tue Dec 17 21:06:41 2019 +0800

    fix NPE.
---
 .../server/core/register/service/ServiceInstanceInventoryRegister.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java
index a581305..047f9c4 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/service/ServiceInstanceInventoryRegister.java
@@ -63,6 +63,7 @@ public class ServiceInstanceInventoryRegister implements IServiceInstanceInvento
         if (serviceInstanceId == Const.NONE) {
             ServiceInstanceInventory serviceInstanceInventory = new ServiceInstanceInventory();
             serviceInstanceInventory.setServiceId(serviceId);
+            serviceInstanceInventory.setServiceInstanceNodeType(NodeType.Unknown);
             serviceInstanceInventory.setName(serviceInstanceName);
             serviceInstanceInventory.setInstanceUUID(uuid);
             serviceInstanceInventory.setIsAddress(BooleanUtils.FALSE);
@@ -89,6 +90,7 @@ public class ServiceInstanceInventoryRegister implements IServiceInstanceInvento
         if (serviceInstanceId == Const.NONE) {
             ServiceInstanceInventory serviceInstanceInventory = new ServiceInstanceInventory();
             serviceInstanceInventory.setServiceId(serviceId);
+            serviceInstanceInventory.setServiceInstanceNodeType(NodeType.Unknown);
             serviceInstanceInventory.setName(serviceInstanceName);
             serviceInstanceInventory.setIsAddress(BooleanUtils.TRUE);
             serviceInstanceInventory.setAddressId(addressId);