You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2014/05/20 06:54:04 UTC

git commit: updated refs/heads/4.4-forward to 497f5e5

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward f748a552e -> 497f5e537


CLOUDSTACK-6712: NPE in findJobInstanceUuid() in ApiDBUtils


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

Branch: refs/heads/4.4-forward
Commit: 497f5e53725c30442040805a3ad42a81ee926f50
Parents: f748a55
Author: Murali Reddy <mu...@gmail.com>
Authored: Tue May 20 10:21:01 2014 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Tue May 20 10:21:01 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiDBUtils.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/497f5e53/server/src/com/cloud/api/ApiDBUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java
index a953cd6..153d998 100755
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -1442,6 +1442,12 @@ public class ApiDBUtils {
         String jobInstanceId = null;
         ApiCommandJobType jobInstanceType = EnumUtils.fromString(ApiCommandJobType.class, job.getInstanceType(), ApiCommandJobType.None);
 
+        if (job.getInstanceId() == null) {
+            // when assert is hit, implement 'getInstanceId' of BaseAsyncCmd and return appropriate instance id
+            assert (false);
+            return null;
+        }
+
         if (jobInstanceType == ApiCommandJobType.Volume) {
             VolumeVO volume = ApiDBUtils.findVolumeById(job.getInstanceId());
             if (volume != null) {