Skip to content

Commit

Permalink
Issue #53: Check that pm_send_notifications exists before updating db (
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored Dec 4, 2023
1 parent 284b209 commit d651e59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pm_email_notify/pm_email_notify.module
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function pm_email_notify_form_alter(&$form, &$form_state, $form_id) {
* Implements hook_user_update().
*/
function pm_email_notify_user_update($account) {
if (privatemsg_user_access('read privatemsg', $account)) {
if (privatemsg_user_access('read privatemsg', $account) && isset($account->pm_send_notifications)) {
db_merge('pm_email_notify')
->fields(array('email_notify_is_enabled' => $account->pm_send_notifications))
->key(array('user_id' => $account->uid))
Expand Down

0 comments on commit d651e59

Please sign in to comment.