From 16d0f841cead2171808b68b597b4ccbc0d6454ae Mon Sep 17 00:00:00 2001
From: Joshua Roys <joshua.roys@gtri.gatech.edu>
Date: Tue, 2 Feb 2010 14:12:22 +0000
Subject: [PATCH] Fix a NPE in CompareConfigFilesTask

---
 .../taskomatic/task/CompareConfigFilesTask.java    |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java b/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java
index bc0127b..1057fb8 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java
@@ -17,6 +17,7 @@ package com.redhat.rhn.taskomatic.task;
 import com.redhat.rhn.domain.action.Action;
 import com.redhat.rhn.domain.action.ActionFactory;
 import com.redhat.rhn.domain.action.config.ConfigAction;
+import com.redhat.rhn.domain.action.config.ConfigRevisionAction;
 import com.redhat.rhn.domain.config.ConfigFile;
 import com.redhat.rhn.domain.config.ConfigRevision;
 import com.redhat.rhn.domain.config.ConfigurationFactory;
@@ -32,6 +33,8 @@ import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 
+import java.util.Set;
+
 /**
  * Compare Config Files
  *  Schedules a comparison of config files on all systems
@@ -88,10 +91,11 @@ public class CompareConfigFilesTask implements Job {
                 ActionFactory.addConfigRevisionToAction(crev, server, cfact);
             }
 
-            if (act.getServerActions().size() < 1) {
+            if (act.getServerActions() == null || act.getServerActions().size() < 1) {
                 continue;
             }
-            if (cfact.getConfigRevisionActions().size() < 1) {
+            Set<ConfigRevisionAction> cra = cfact.getConfigRevisionActions();
+            if (cra == null || cra.size() < 1) {
                 continue;
             }
 
-- 
1.6.5.2

