1
0
Fork 0

Add checks for $a->user existence

- Variable can be empty/null in many cases
This commit is contained in:
Hypolite Petovan 2020-07-09 15:08:09 -04:00
commit cb03418937
4 changed files with 8 additions and 8 deletions

View file

@ -224,7 +224,7 @@ function frio_remote_nav($a, &$nav)
// since $userinfo isn't available for the hook we write it to the nav array
// this isn't optimal because the contact query will be done now twice
if (local_user()) {
if (local_user() && !empty($a->user['uid'])) {
// empty the server url for local user because we won't need it
$server_url = '';
// user info

View file

@ -27,7 +27,7 @@ function vier_init(App $a)
Renderer::setActiveTemplateEngine('smarty3');
if (!empty($a->argv[0]) && ($a->argv[0] . ($a->argv[1] ?? '')) === ('profile' . $a->user['nickname']) || $a->argv[0] === 'network' && local_user()) {
if (!empty($a->argv[0]) && ($a->argv[0] . ($a->argv[1] ?? '')) === ('profile' . ($a->user['nickname'] ?? '')) || $a->argv[0] === 'network' && local_user()) {
vier_community_info();
DI::page()['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";