Hasnayeen / themes

Themes for Filament panels.
MIT License
217 stars 30 forks source link

[Bug]: Call to a member function can() on null #19

Closed stephenjude closed 1 year ago

stephenjude commented 1 year ago

What happened?

When a Filament user logs out this method canViewThemesPage(fn () => auth()->user()->is_admin) returns a Call to a member function can() on null error due to the absence of authenticated user object.

How to reproduce the bug

image

Package Version

3.0

Filament Version

3.0

PHP Version

8.2

Laravel Version

10

Notes

No response

Hasnayeen commented 1 year ago

This is not a bug, this method runs user provided callback function so if user pass invalid code then there will be error. For example if someone pass non existent method to the canViewThemesPage then there will be error

canViewThemesPage(fn () => non_existent_method())