You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/07/13 03:32:39 UTC

[dubbo] branch 3.0 updated: Fix NPE when parse migration rule error happen (#8280)

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

albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 3440f39  Fix NPE when parse migration rule error happen (#8280)
3440f39 is described below

commit 3440f39c10dc333dfb6e1703e0e2ee1350738557
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Tue Jul 13 11:30:33 2021 +0800

    Fix NPE when parse migration rule error happen (#8280)
---
 .../apache/dubbo/registry/client/migration/MigrationRuleListener.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
index f1fea06..4c2d75d 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
@@ -180,7 +180,7 @@ public class MigrationRuleListener implements RegistryProtocolListener, Configur
     }
 
     private MigrationRule parseRule(String rawRule) {
-        MigrationRule tmpRule = rule;
+        MigrationRule tmpRule = rule == null ? MigrationRule.INIT : rule;
         if (INIT.equals(rawRule)) {
             tmpRule = MigrationRule.INIT;
         } else {