Admin area is unavailable for users without podcast / actor linked to them
Describe the bug
When a user tries to login in the admin area without having a podcast / actor, a message error prevents them from doing anything.
Steps to reproduce
- Connect as a superadmin
- Create at least one podcast
- Create a new user with superadmin priviledges
- Connect with the new user
- See error.
Expected behavior
The new user should be able to access the admin area.
Relevant logs and/or screenshots
CRITICAL - 2022-03-07 10:14:21 --> Attempt to read property "avatar_image_url" on bool
#0 /castopod/themes/cp_admin/_partials/_nav_header.php(28): CodeIgniter\Debug\Exceptions->errorHandler()
#1 /castopod/app/Libraries/View.php(90): include('...')
#2 /castopod/app/Libraries/View.php(93): App\Libraries\View->App\Libraries\{closure}()
#3 /castopod/vendor/codeigniter4/framework/system/View/View.php(424): App\Libraries\View->render()
#4 /castopod/themes/cp_admin/_layout.php(27): CodeIgniter\View\View->include()
#5 /castopod/app/Libraries/View.php(90): include('...')
#6 /castopod/app/Libraries/View.php(93): App\Libraries\View->App\Libraries\{closure}()
#7 /castopod/app/Libraries/View.php(106): App\Libraries\View->render()
#8 /castopod/app/Common.php(44): App\Libraries\View->render()
#9 /castopod/modules/Admin/Controllers/PodcastController.php(57): view()
#10 /castopod/modules/Admin/Controllers/PodcastController.php(32): Modules\Admin\Controllers\PodcastController->list()
#11 /castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(830): Modules\Admin\Controllers\PodcastController->_remap()
#12 /castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(419): CodeIgniter\CodeIgniter->runController()
#13 /castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(326): CodeIgniter\CodeIgniter->handleRequest()
#14 /castopod/public/index.php(41): CodeIgniter\CodeIgniter->run()
#15 {main}
Context
- Castopod: v1.0.0-beta.9
- OS: Ubuntu server 20.04
- Browser: any
- Web server: Nginx
Possible fixes
Check if user_can_interact before displaying any actor avatar.