Fatal error: Call to a member function getId() on null in /home/klient.dhosting.pl/tkptkp/tkp.com.pl/src/Tom/SiteBundle/Controller/ArticlesController.php on line 50

Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Error: Call to a member function getId() on null' in /home/klient.dhosting.pl/tkptkp/tkp.com.pl/src/Tom/SiteBundle/Controller/ArticlesController.php:50 Stack trace: #0 {main} Next exception 'RuntimeException' with message 'Failed to start the session because headers have already been sent by "/home/klient.dhosting.pl/tkptkp/tkp.com.pl/src/Tom/SiteBundle/Controller/ArticlesController.php" at line 50.' in /home/klient.dhosting.pl/tkptkp/tkp.com.pl/app/cache/prod/classes.php:118 Stack trace: #0 /home/klient.dhosting.pl/tkptkp/tkp.com.pl/app/cache/prod/classes.php(192): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() #1 /home/klient.dhosting.pl/tkptkp/tkp.com.pl/app/cache/prod/classes.php(565): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag('flashes') #2 /home/klient.dhosting.pl/tkptkp/tkp.com.pl/app/cache/prod/classes.php(569): Symfony\Component\HttpFoundation\Se in /home/klient.dhosting.pl/tkptkp/tkp.com.pl/app/cache/prod/classes.php on line 5221