Call to a member function getUrl() on null

Problem:

Bad  SQL data in media table

Solution:

If you are seeing this error in your laravel when you are using Spatie Media Library it is because you have records in your SQL media table that have corrupted or "Null" values. One way I was able to resolve this error was by refreshing my migration (reseting my database) Collection.

php artisan migrate:fresh

It should work now.