From f3a2fc22bf21b8a7019d10f4a864f7427332a9b6 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 12 Jul 2013 13:57:53 +0530 Subject: [PATCH] CLOUDSTACK-3485: NPE while getting instance ID from Asyn Job when publishing async job events on eventbus handing case where instance id is null in the asyn job, while publishing asyn job events on to event bus --- server/src/com/cloud/api/ApiDBUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index 073e4c27618..49a6ebaa036 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -1279,9 +1279,11 @@ public class ApiDBUtils { } public static String findJobInstanceUuid(AsyncJob job){ - if ( job == null ) + if ( job == null || job.getInstanceId() == null) return null; + String jobInstanceId = null; + if (job.getInstanceType() == AsyncJob.Type.Volume) { VolumeVO volume = ApiDBUtils.findVolumeById(job.getInstanceId()); if (volume != null) {