pyrocms/pyrocms — Issue #961: Non-Object on /users when not logged in
Author: rmwebs
Created: 2011-12-02 17:15:56+00:00
State: open

If a user browses to /users when not logged in, the following error occurs:

>A PHP Error was encountered
>
>Severity: Notice
>
>Message: Trying to get property of non-object
>
>Filename: controllers/users.php
>
>Line Number: 37

On the PyroCMS.com site, another error also occurs below it:

>An Error Was Encountered
>Unable to locate the file: page.php

Reproducible on v2 beta 1, and by visiting pyrocms.com/users when logged out.

Fix:

edit /controllers/users.php and replace the contents of the index function with a check to see if the user id is set:
```php
if(isset($this->current_user->id))
{
$this->view($this->current_user->id);
}
else
{
$this->view();
}
```