[Warning] Attempt to read property "FirstName" on null

GET /wir-ueber-uns/gab-team/vcard/13

Line 73 in /is/htdocs/wp13793171_SGXHXOAAD3/www/gab-silverstripe5-2023/app/src/StaffMemberPage.php

Source

64 
65     public function vcard(HTTPRequest $request) {
66 
67         $id = $request->getVar('ID');
68 
69         $staff = DataObject::get_by_id("StaffMember",$id);
70 
71 
72         header("Content-Type: text/x-vcard");
73         header("Content-Disposition: attachment; filename=" . addslashes($staff->FirstName . "-" . $staff->Name . ".vcf"));
74         //header('Connection: close');
75 
76         $out = $staff->renderWith("vcard");
77         print $out;
78         exit;
79     }

Trace

GET /wir-ueber-uns/gab-team/vcard/13

[Warning] Attempt to read property "Name" on null

GET /wir-ueber-uns/gab-team/vcard/13

Line 73 in /is/htdocs/wp13793171_SGXHXOAAD3/www/gab-silverstripe5-2023/app/src/StaffMemberPage.php

Source

64 
65     public function vcard(HTTPRequest $request) {
66 
67         $id = $request->getVar('ID');
68 
69         $staff = DataObject::get_by_id("StaffMember",$id);
70 
71 
72         header("Content-Type: text/x-vcard");
73         header("Content-Disposition: attachment; filename=" . addslashes($staff->FirstName . "-" . $staff->Name . ".vcf"));
74         //header('Connection: close');
75 
76         $out = $staff->renderWith("vcard");
77         print $out;
78         exit;
79     }

Trace

GET /wir-ueber-uns/gab-team/vcard/13

[Warning] Cannot modify header information - headers already sent by (output started at /is/htdocs/wp13793171_SGXHXOAAD3/www/gab-silverstripe5-2023/vendor/silverstripe/framework/src/Control/HTTPResponse.php:421)

GET /wir-ueber-uns/gab-team/vcard/13

Line 73 in /is/htdocs/wp13793171_SGXHXOAAD3/www/gab-silverstripe5-2023/app/src/StaffMemberPage.php

Source

64 
65     public function vcard(HTTPRequest $request) {
66 
67         $id = $request->getVar('ID');
68 
69         $staff = DataObject::get_by_id("StaffMember",$id);
70 
71 
72         header("Content-Type: text/x-vcard");
73         header("Content-Disposition: attachment; filename=" . addslashes($staff->FirstName . "-" . $staff->Name . ".vcf"));
74         //header('Connection: close');
75 
76         $out = $staff->renderWith("vcard");
77         print $out;
78         exit;
79     }

Trace

GET /wir-ueber-uns/gab-team/vcard/13

[Emergency] Uncaught Error: Call to a member function renderWith() on null

GET /wir-ueber-uns/gab-team/vcard/13

Line 76 in /is/htdocs/wp13793171_SGXHXOAAD3/www/gab-silverstripe5-2023/app/src/StaffMemberPage.php

Source

67         $id = $request->getVar('ID');
68 
69         $staff = DataObject::get_by_id("StaffMember",$id);
70 
71 
72         header("Content-Type: text/x-vcard");
73         header("Content-Disposition: attachment; filename=" . addslashes($staff->FirstName . "-" . $staff->Name . ".vcf"));
74         //header('Connection: close');
75 
76         $out = $staff->renderWith("vcard");
77         print $out;
78         exit;
79     }
80 
81 }

Trace