[Notice] Trying to get property 'ID' of non-object

GET /stories/selected/articles

Line 127 in /var/www/html/celogic24/app/src/StoriesPage.php

Source

118 	        'index',
119 	    ];
120 
121 	    protected $current_categoryID;
122 	    // protected $articleList;
123 
124 		public function selected(HTTPRequest $request) {
125 
126 			$category = StoryCategory::get()->filter(array('URL' => $request->param('ID')))->First();
127 			$this->current_categoryID = $category->ID;
128 
129 			if(!$category) {
130 				return $this->httpError(404, 'That category could not be found.');
131 			}
132 
133 			// $this->articleList = $this->articleList->filter([

Trace

ERROR [User Warning]: Couldn't set response type to 404 because of output on line 419 of /var/www/html/celogic24/vendor/silverstripe/framework/src/Control/HTTPResponse.php IN GET /stories/selected/articles Line 397 in /var/www/html/celogic24/vendor/silverstripe/framework/src/Control/HTTPResponse.php Source ====== 388: } elseif ($this->getStatusCode() >= 300) { 389: // It's critical that these status codes are sent; we need to report a failure if not. 390: user_error( 391: sprintf( 392: "Couldn't set response type to %d because of output on line %s of %s", 393: $this->getStatusCode(), 394: $line, 395: $file 396: ), * 397: E_USER_WARNING 398: ); 399: } 400: } 401: 402: /** 403: * Output body of this response to the browser Trace ===== user_error(Couldn't set response type to 404 because of output on line 419 of /var/www/html/celogic24/vendor/silverstripe/framework/src/Control/HTTPResponse.php, 512) HTTPResponse.php:397 SilverStripe\Control\HTTPResponse->outputHeaders() HTTPResponse.php:343 SilverStripe\Control\HTTPResponse->output() index.php:27 Page not found | CE-Logic Inc.