svn commit: r671888 - /lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Thu Jun 26 06:02:02 2008
New Revision: 671888

URL: http://svn.apache.org/viewvc?rev=671888&view=rev
Log:
Verify existence of sender+recipient users in change notifier.

Modified:
    lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java

Modified: lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java
URL: http://svn.apache.org/viewvc/lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java?rev=671888&r1=671887&r2=671888&view=diff
==============================================================================
--- lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java (original)
+++ lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java Thu Jun 26 06:02:02 2008
@@ -48,6 +48,7 @@
 import org.apache.lenya.modules.diff.xml.DomTreeBuilder;
 import org.apache.lenya.modules.diff.xml.DomTreeBuilderFactory;
 import org.apache.lenya.notification.Message;
+import org.apache.lenya.notification.NotificationException;
 import org.apache.lenya.notification.Notifier;
 import org.apache.lenya.xml.DocumentHelper;
 
@@ -158,7 +159,13 @@
 
                     String[] bodyParams = { title, documentUrl, userParam, writer.toString() };
                     User sender = getUser(url, this.sender);
+                    if (sender == null) {
+                        throw new NotificationException("The sender [" + this.sender + "] does not exist.");
+                    }
                     User recipient = getUser(url, this.recipient);
+                    if (sender == null) {
+                        throw new NotificationException("The recipient [" + this.recipient + "] does not exist.");
+                    }
                     User[] recipients = { recipient };
 
                     Message message = new Message(SUBJECT, subjectParams, BODY, bodyParams, sender,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.