Skip to content

Commit 6280205

Browse files
authored
[ISSUE apache#7293] Fix NPE when alter sync state set
1 parent e11e294 commit 6280205

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controller/src/main/java/org/apache/rocketmq/controller/impl/manager/ReplicasInfoManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public ControllerResult<AlterSyncStateSetResponseHeader> alterSyncStateSet(
104104
}
105105

106106
// Check master
107-
if (!syncStateInfo.getMasterBrokerId().equals(request.getMasterBrokerId())) {
107+
if (syncStateInfo.getMasterBrokerId() == null || !syncStateInfo.getMasterBrokerId().equals(request.getMasterBrokerId())) {
108108
String err = String.format("Rejecting alter syncStateSet request because the current leader is:{%s}, not {%s}",
109109
syncStateInfo.getMasterBrokerId(), request.getMasterBrokerId());
110110
LOGGER.error("{}", err);

0 commit comments

Comments
 (0)