You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2013/10/05 02:05:42 UTC

git commit: updated refs/heads/master to b3c1784

Updated Branches:
  refs/heads/master f8976a41c -> b3c178480


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.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b3c17848
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b3c17848
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b3c17848

Branch: refs/heads/master
Commit: b3c178480b4760c2cc66b8319333ae34a8dca1d2
Parents: f8976a4
Author: Darren Shepherd <da...@gmail.com>
Authored: Fri Oct 4 17:05:15 2013 -0700
Committer: Darren Shepherd <da...@gmail.com>
Committed: Fri Oct 4 17:05:15 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3c17848/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java b/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
index d0effab..ace7c91 100644
--- a/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
+++ b/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
@@ -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 ) {