Error
Call to a member function getName() on null Error thrown with message "Call to a member function getName() on null" Stacktrace: #2 Error in /home/psinv/public_html/functions.php:2899 #1 crm_get_meta in /home/psinv/public_html/src/pages/header.php:42 #0 include in /home/psinv/public_html/index.php:1853
Stack frames (3):
2 Error
…/­functions.php2899
1 crm_get_meta
…/­src/­pages/­header.php42
0 include
…/­index.php1853
/home/psinv/public_html/functions.php
        $meta['description'] = "⚡ ".__('View the','realia'). " ".__('Location map','realia'). " ".__('of','realia'). " ". __($getName,'realia'). " " .__('at','realia'). " ". __($getSubCommunityName,'realia'). " ". __($getCommunityName,'realia'). ', '. __('Book a viewing today!', 'realia').  " - " .__('Property Shop Investment, Abu Dhabi','realia');
        $meta['keywords'] = $getSeoKeywords;
    }  elseif( 'project-nearbyamenities' == $_route  ) { 
        global $nearby;
        if(!empty($nearby)){
            $nearby_txt = explode('near',$nearby);
            $nearby_txt = $nearby_txt[0]; 
            $nearby_txt = explode('-',$nearby_txt);
            $nearby_txt = $nearby_txt[0]; 
            $meta['title'] =  "⚡ ".__('Nearby ','realia').__($nearby_txt,'realia').__(' in ','realia'). __($projectObj->getName(),'realia') . ', '. __($projectObj->getCommunityName(),'realia');
            $meta['description'] = "⚡ ".__('Find the best','realia'). ' '.__($nearby_txt,'realia').__(' near ','realia').  __($projectObj->getName(),'realia'). ", " . __($projectObj->getSubCommunityName(),'realia'). " " . __($projectObj->getCommunityName(),'realia').  ' - '.__('PSI','realia');
            $meta['keywords'] = $projectObj->getSeoKeywords();
        }else{
            $meta['title'] = "⚡ ".__('Nearby amenities around', 'realia').' ' . __($projectObj->getName(),'realia').', '.__($projectObj->getCommunityName(),'realia');
            $meta['description'] = "⚡ ".__('Discover the best nearby amenities around', 'realia').' ' . __($projectObj->getName(),'realia').', '. __($projectObj->getSubCommunityName(),'realia'). " " . __($projectObj->getCommunityName(),'realia');
            $meta['keywords'] = $projectObj->getSeoKeywords();
        }
        $descLength = strlen($meta['description']);        
        if($descLength < 120){$meta['description'] .= " " . __($projectObj->getCityName(),'realia').' - '. __('Property Shop Investment','realia').' - '. __('Book a viewing today!', 'realia');}
        else{$meta['description'] .= ' '.__('PSI','realia');}
/home/psinv/public_html/src/pages/header.php
<!DOCTYPE html>
<html lang="en-US">
    <head>
    <meta name="facebook-domain-verification" content="ezmak3v00vwq5o11bvf5siduu44wgs" />
    <meta charset="utf-8">
    <link rel="canonical" href="<?php echo crm_get_canonical_url(); ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-control" content="public">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
    <?php $meta = crm_get_meta( $_route ); ?>
    <title><?php echo $meta['title']; ?></title>
    <meta name="description" content="<?php echo $meta['description']; ?>">
    <meta name="author" content="<?php echo $meta['author']; ?>">
    <meta name="keywords" content="<?php echo $meta['keywords']; ?>">
    <meta property="og:title" content=" <?php echo $meta['title']; ?>" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="<?php echo crm_get_canonical_url(); ?>" />
    <meta property="og:description" content=" <?php echo $meta['description']; ?>" />
    <meta property="og:image:type" content="image/jpeg" />
    <?php echo allowindex($_route);?>
/home/psinv/public_html/index.php
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
            if(!$hidehtml) include __DIR__.'/src/pages/footer-search-test.php';
        }
        elseif ($_route == 'international'|| $_route == 'test' || $_route =='international-test2'){
            if(!$hidehtml) include __DIR__.'/src/pages/header-international.php'; 
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
            if(!$hidehtml) include __DIR__.'/src/pages/footer-content-international.php';
        }
        else { 
            if(!$hidehtml) include __DIR__.'/src/pages/header.php'; 
            include sprintf(__DIR__.'/src/pages/%s.php', $_route);
            if(!$hidehtml) include __DIR__.'/src/pages/footer.php';
        }

    } elseif( $amp ) {
        include __DIR__.'/src/amp-pages/header.php'; 
        include sprintf(__DIR__.'/src/amp-pages/%s.php', $_route);
        include __DIR__.'/src/amp-pages/footer.php';
    }
     

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE Apache
REQUEST_URI /ar/projects/abu-dhabi/yas-island/yas-acres/yas-acres-the-magnolias/nearby/restaurant-near-to-yas-acres-the-magnolias
CONTEXT_DOCUMENT_ROOT /home/psinv/public_html
CONTEXT_PREFIX
DOCUMENT_ROOT /home/psinv/public_html
GATEWAY_INTERFACE CGI/1.1
H2PUSH off
H2_PUSH off
H2_PUSHED
H2_PUSHED_ON
H2_STREAM_ID 3
H2_STREAM_TAG 5888-646-3
HTTP2 on
HTTPS on
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, br
HTTP_AUTHORIZATION
HTTP_CDN_LOOP cloudflare
HTTP_CF_CONNECTING_IP 54.165.122.173
HTTP_CF_IPCOUNTRY US
HTTP_CF_RAY 86b8e4a9de6d1733-IAD
HTTP_CF_VISITOR {\"scheme\":\"https\"}
HTTP_HOST psinv.net
HTTP_REFERER https://psinv.net/ar/abu-dhabi/yas-island/yas-acres/yas-acres-the-magnolias/nearby/restaurant-near-to-yas-acres-the-magnolias
HTTP_USER_AGENT claudebot
HTTP_X_FORWARDED_FOR 54.165.122.173
HTTP_X_FORWARDED_PROTO https
PATH /bin:/usr/bin
PHP_INI_SCAN_DIR /opt/cpanel/ea-php73/root/etc:/opt/cpanel/ea-php73/root/etc/php.d:.
QUERY_STRING
REDIRECT_H2PUSH off
REDIRECT_H2_PUSH off
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_STREAM_ID 3
REDIRECT_H2_STREAM_TAG 5888-646-3
REDIRECT_HTTP2 on
REDIRECT_HTTPS on
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_SSL_TLS_SNI psinv.net
REDIRECT_STATUS 200
REDIRECT_UNIQUE_ID ZgWWizSM227zmPLmkyEDagAAFAo
REDIRECT_URL /ar/projects/abu-dhabi/yas-island/yas-acres/yas-acres-the-magnolias/nearby/restaurant-near-to-yas-acres-the-magnolias
REMOTE_ADDR 172.69.40.170
REMOTE_PORT 35264
REQUEST_METHOD GET
REQUEST_SCHEME https
SCRIPT_FILENAME /home/psinv/public_html/index.php
SCRIPT_NAME /index.php
SERVER_ADDR 162.214.200.92
SERVER_ADMIN [email protected]
SERVER_NAME psinv.net
SERVER_PORT 443
SERVER_PROTOCOL HTTP/2.0
SERVER_SIGNATURE
SSL_TLS_SNI psinv.net
TZ Asia/Dubai
UNIQUE_ID ZgWWizSM227zmPLmkyEDagAAFAo
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711642251.1182
REQUEST_TIME 1711642251
argv Array ( )
argc 0
empty
0. Whoops\Handler\PrettyPageHandler