Title: Check for NULL
Last modified: December 12, 2016

---

# Check for NULL

 *  Resolved [stiil](https://wordpress.org/support/users/stiil/)
 * (@stiil)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/pr-check-for-null/)
 * [Link to Repo](https://plugins.trac.wordpress.org/browser/restrict-content-by-role/trunk/php/class.MenuAccess.php#L44)
 *     ```
       if( $object !== NULL && 'nav_menu_item' !== $object->post_type ) {
       ```
   
 * [Link to Repo](https://plugins.trac.wordpress.org/browser/restrict-content-by-role/trunk/php/class.AdminAccess.php#L253)
 *     ```
       $old_parent = $post !== NULL ? $post->post_parent : NULL;
       ```
   
 * Check if object exists before accessing the object 🙂
    -  This topic was modified 9 years, 5 months ago by [stiil](https://wordpress.org/support/users/stiil/).
      Reason: Added another occurance
    -  This topic was modified 9 years, 5 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Matt Watson](https://wordpress.org/support/users/mwtsn/)
 * (@mwtsn)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/pr-check-for-null/#post-8708768)
 * Thanks [@still](https://wordpress.org/support/users/still/),
 * Now on my bug list: [https://github.com/mkdo/restrict-content-by-role/issues/6](https://github.com/mkdo/restrict-content-by-role/issues/6)

Viewing 1 replies (of 1 total)

The topic ‘Check for NULL’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/restrict-content-by-role_2774a0.svg)
 * [Restrict Content by Role](https://wordpress.org/plugins/restrict-content-by-role/)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-content-by-role/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-content-by-role/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-content-by-role/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-content-by-role/reviews/)

## Tags

 * [Pull Request](https://wordpress.org/support/topic-tag/pull-request/)

 * 1 reply
 * 2 participants
 * Last reply from: [Matt Watson](https://wordpress.org/support/users/mwtsn/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/pr-check-for-null/#post-8708768)
 * Status: resolved