diff -r ed84c8bdd87b -r c404a87db5b7 src/org/sonews/mlgw/Dispatcher.java --- a/src/org/sonews/mlgw/Dispatcher.java Sun Aug 29 17:28:58 2010 +0200 +++ b/src/org/sonews/mlgw/Dispatcher.java Sun Aug 29 17:43:58 2010 +0200 @@ -143,6 +143,11 @@ */ public static boolean toGroup(final Message msg) { + if(msg == null) + { + throw new IllegalArgumentException("Argument 'msg' must not be null!"); + } + try { // Create new Article object @@ -159,14 +164,17 @@ { // Check for duplicate entries of the same group Article oldArticle = StorageManager.current().getArticle(article.getMessageID()); - List oldGroups = oldArticle.getGroups(); - for(Group oldGroup : oldGroups) - { - if(!newsgroups.contains(oldGroup.getName())) + if(oldArticle != null) + { + List oldGroups = oldArticle.getGroups(); + for(Group oldGroup : oldGroups) { - oldgroups.add(oldGroup.getName()); + if(!newsgroups.contains(oldGroup.getName())) + { + oldgroups.add(oldGroup.getName()); + } } - } + } } if(newsgroups.size() > 0)