Yuta HIGUCHI

minor bug fix

Change-Id: Icfe2f2b5cfefa6fc8a7e55ceb86a6785e57f04b3
...@@ -447,7 +447,13 @@ implements MastershipStore { ...@@ -447,7 +447,13 @@ implements MastershipStore {
447 RoleValue oldValue = event.getOldValue(); 447 RoleValue oldValue = event.getOldValue();
448 RoleValue newValue = event.getValue(); 448 RoleValue newValue = event.getValue();
449 449
450 - if (Objects.equal(oldValue.get(MASTER), newValue.get(MASTER))) { 450 + NodeId oldMaster = null;
451 + if (oldValue != null) {
452 + oldMaster = oldValue.get(MASTER);
453 + }
454 + NodeId newMaster = newValue.get(MASTER);
455 +
456 + if (Objects.equal(oldMaster, newMaster)) {
451 notifyDelegate(new MastershipEvent( 457 notifyDelegate(new MastershipEvent(
452 MASTER_CHANGED, event.getKey(), event.getValue().roleInfo())); 458 MASTER_CHANGED, event.getKey(), event.getValue().roleInfo()));
453 } else { 459 } else {
......