continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r329893 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/ continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/ continuum-notifiers/contin...
Date Mon, 31 Oct 2005 20:54:46 GMT
Author: evenisse
Date: Mon Oct 31 12:54:36 2005
New Revision: 329893

URL: http://svn.apache.org/viewcvs?rev=329893&view=rev
Log:
Fix NPE

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=329893&r1=329892&r2=329893&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
Mon Oct 31 12:54:36 2005
@@ -317,7 +317,12 @@
 
     private String generateSubject( Project project, BuildResult build )
     {
-        int state = build.getState();
+        int state = -1;
+
+        if ( build != null )
+        {
+            state = build.getState();
+        }
 
         if ( state == ContinuumProjectState.OK )
         {
@@ -333,9 +338,9 @@
         }
         else
         {
-            getLogger().warn( "Unknown build state " + build.getState() + " for project "
+ project.getId() );
+            getLogger().warn( "Unknown build state " + state + " for project " + project.getId()
);
 
-            return "[continuum] ERROR: Unknown build state " + build.getState() + " for "
+ project.getName() + " project";
+            return "[continuum] ERROR: Unknown build state " + state + " for " + project.getName()
+ " project";
         }
     }
 

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=329893&r1=329892&r2=329893&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Mon Oct 31 12:54:36 2005
@@ -163,7 +163,12 @@
     private String generateMessage( Project project, BuildResult build )
         throws ContinuumException
     {
-        int state = build.getState();
+        int state = -1;
+
+        if ( build != null )
+        {
+            state = build.getState();
+        }
 
         String message;
 
@@ -181,9 +186,9 @@
         }
         else
         {
-            getLogger().warn( "Unknown build state " + build.getState() + " for project "
+ project.getId() );
+            getLogger().warn( "Unknown build state " + state + " for project " + project.getId()
);
 
-            message = "ERROR: Unknown build state " + build.getState() + " for " + project.getName()
+ " project";
+            message = "ERROR: Unknown build state " + state + " for " + project.getName()
+ " project";
         }
 
         return message + " " + getReportUrl( project, build, configurationService );

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java?rev=329893&r1=329892&r2=329893&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
Mon Oct 31 12:54:36 2005
@@ -121,7 +121,12 @@
     private String generateMessage( Project project, BuildResult build )
         throws ContinuumException
     {
-        int state = build.getState();
+        int state = -1;
+
+        if ( build != null )
+        {
+            state = build.getState();
+        }
 
         String message;
 
@@ -139,9 +144,9 @@
         }
         else
         {
-            getLogger().warn( "Unknown build state " + build.getState() + " for project "
+ project.getId() );
+            getLogger().warn( "Unknown build state " + state + " for project " + project.getId()
);
 
-            message = "ERROR: Unknown build state " + build.getState() + " for " + project.getName()
+ " project";
+            message = "ERROR: Unknown build state " + state + " for " + project.getName()
+ " project";
         }
 
         return message + " " + getReportUrl( project, build, configurationService );



Mime
View raw message