Merge commit 'origin/platal-0.10.0'
[platal.git] / include / newsletter.inc.php
index 9e1a59b..c58844e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -45,6 +45,9 @@ class NewsLetter extends MassMailer
             }
             $res = XDB::query("SELECT * FROM newsletter WHERE bits='new'");
         }
+        if ($res->numRows() != 1) {
+            throw new MailNotFound();
+        }
         $nl = $res->fetchOneAssoc();
 
         $this->_id        = $nl['id'];