Fix: resolve NPE when inject non-existing compute node through SONA

Change-Id: I4b828c0c8e303bc1c27854899a5dc568a8be55cb
This commit is contained in:
Jian Li 2018-03-30 11:17:42 +09:00
parent f7921bd74d
commit 7ddea787bc

View File

@ -292,6 +292,9 @@ public final class OpenstackSwitchingHostProvider extends AbstractProvider imple
public boolean isRelevant(OpenstackNodeEvent event) {
// do not allow to proceed without mastership
Device device = deviceService.getDevice(event.subject().intgBridge());
if (device == null) {
return false;
}
return mastershipService.isLocalMaster(device.id());
}