Title: Error message in modules.php
Last modified: September 11, 2019

---

# Error message in modules.php

 *  Resolved [sunrosea](https://wordpress.org/support/users/sunrosea/)
 * (@sunrosea)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/error-message-in-modules-php/)
 * Hello!
 * There is an error that occurs when a non-newsletter user tries to access the 
   newsletter profile page.
 * `Notice: Trying to get property 'token' of non-object in /customers/e/0/e/[redacted]/
   httpd.www/wp-content/plugins/newsletter/includes/module.php on line 952`
 * The line 952 has the check: `if($token != $user->token)` which throws as error
   since $user isn’t set when there’s no newsletter user.
 * Until it’s fixed, I added and extra if statement to check if $user is set to 
   prevent the error message being shown.
 *     ```
       if(isset($user)){
         if ($token != $user->token) {
            $user = null;
         }
       }
       else{
         $user = null;
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Stefano Lissa](https://wordpress.org/support/users/satollo/)
 * (@satollo)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/error-message-in-modules-php/#post-11921837)
 * Thank you very much!
 * I’ve already fixed it and will be available on next release.
 * Stefano.
 *  Thread Starter [sunrosea](https://wordpress.org/support/users/sunrosea/)
 * (@sunrosea)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/error-message-in-modules-php/#post-11921851)
 * Great to hear!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error message in modules.php’ is closed to new replies.

 * ![](https://ps.w.org/newsletter/assets/icon-256x256.png?rev=1052028)
 * [Newsletter - Send awesome emails from WordPress](https://wordpress.org/plugins/newsletter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/newsletter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/newsletter/)
 * [Active Topics](https://wordpress.org/support/plugin/newsletter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/newsletter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/newsletter/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [sunrosea](https://wordpress.org/support/users/sunrosea/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/error-message-in-modules-php/#post-11921851)
 * Status: resolved