[Notice] Trying to get property of non-object

GET /mens-sports/mens-baseball/roster/athlete/2194

Line 31 in /home/herkimer/www/roster/code/RosterHolderPage.php

Source

22 
23   private static $allowed_actions = array(
24     'athlete',
25     'archive'
26   );
27 
28   public function athlete() {
29     if($athlete = RosterMember::get()->byID($this->request->param('ID'))) {
30 
31       $year = substr($athlete->Rosters()->first()->Title, 0, 4);
32 
33       $returnlink = false;
34       if(array_key_exists('HTTP_REFERER', $_SERVER) && strpos($_SERVER['HTTP_REFERER'], 'archive') !== false) {
35         $returnlink = Controller::join_links(
36               Director::get_current_page()->Link(),
37               'archive',

Trace

Joe DeSarro » Herkimer Generals
2018 Baseball Roster
JoeDeSarro2015BaseballAthleticStaffPhoto
#6

Joe DeSarro

Height:
6'1''
Weight:
185
Year:
Freshman
Hometown:
Frankfort, NY
High School:
Frankfort
Position:
OF
Major:
Business: Business Administration

- Return to Roster

Baseball
×