Committed by
Gerrit Code Review
Fixes a NPE that occurs when device mastership is not immediately decided
Change-Id: I170974bf9e70cef5d7e73ecf31901879d858ddf7
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -307,7 +307,7 @@ public class DeviceManager | ... | @@ -307,7 +307,7 @@ public class DeviceManager |
307 | // check my Role | 307 | // check my Role |
308 | mastershipService.requestRoleFor(deviceId); | 308 | mastershipService.requestRoleFor(deviceId); |
309 | final MastershipTerm term = termService.getMastershipTerm(deviceId); | 309 | final MastershipTerm term = termService.getMastershipTerm(deviceId); |
310 | - if (!myNodeId.equals(term.master())) { | 310 | + if (term == null || !myNodeId.equals(term.master())) { |
311 | log.info("Role of this node is STANDBY for {}", deviceId); | 311 | log.info("Role of this node is STANDBY for {}", deviceId); |
312 | // TODO: Do we need to explicitly tell the Provider that | 312 | // TODO: Do we need to explicitly tell the Provider that |
313 | // this instance is not the MASTER | 313 | // this instance is not the MASTER | ... | ... |
-
Please register or login to post a comment