Browse code

fix runtime warning when creating new mail address

Bernd Wurst authored on19/11/2019 11:50:56
Showing2 changed files
... ...
@@ -58,6 +58,7 @@ function get_contact($id, $customer = null)
58 58
         "id" => (int) $id);
59 59
     $result = db_query("SELECT id, state, lastchange, nic_id, nic_handle, salutation, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id, pgp_key FROM kundendaten.contacts WHERE id=:id AND customer=:cid", $args);
60 60
     if ($result->rowCount() == 0) {
61
+        DEBUG("Soll Kontakt #".$id." laden, MySQL lieferte aber keine Daten");
61 62
         system_failure("Kontakt nicht gefunden oder gehört nicht diesem Kunden");
62 63
     }
63 64
     $contact = $result->fetch();
... ...
@@ -74,6 +74,9 @@ function get_vmail_id_by_emailaddr($emailaddr)
74 74
 {
75 75
     $result = db_query("SELECT id FROM mail.v_vmail_accounts WHERE CONCAT(local, '@', domainname) = ?", array($emailaddr));
76 76
     $entry = $result->fetch();
77
+    if ($entry === false) {
78
+        return false;
79
+    }
77 80
     return (int) $entry['id'];
78 81
 }
79 82