Check for null just in case

This code was recently switched from using HashMap to ConcurrentHashMap.
ConcurrentHashMap does not accept null keys and will through a NPE.  Adding
a null check just in case somebody passes null.
This commit is contained in:
Darren Shepherd 2013-10-04 17:05:15 -07:00
parent f8976a41ce
commit b3c178480b
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ public class HypervisorGuruManagerImpl extends ManagerBase implements Hypervisor
@Override
public HypervisorGuru getGuru(HypervisorType hypervisorType) {
if (hypervisorType == null) {
return null;
}
HypervisorGuru result = _hvGurus.get(hypervisorType);
if ( result == null ) {