Fix fatal errors caused when access is checked without a user loaded in js.php
Merge pull request #4246 from openscholar/4202-fatals

Fix fatal errors caused when access is checked without a user loaded in js.php