I'm seeing lots of errors like this in my log file. Looking at the code, it's seems to be caused by the order of one of my collection. Or not? I'm not sure.

I'm having trouble debugging this error. Maybe someone here can help? I'm using Statamic 2.11.17 btw.

I'm also getting intermittent error reports from users about the site being broken/not accessible. Not sure if it's related.

Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function order() on null
in /var/www/statamic/core/Data/Entries/Entry.php:185
Stack trace:
#0 /var/www/statamic/core/Data/Entries/Entry.php(196): Statamic\Data\Entries\Entry->orderType()
#1 /var/www/statamic/core/Data/Content/UrlBuilder.php(112): Statamic\Data\Entries\Entry->date()
#2 /var/www/statamic/core/Data/Content/UrlBuilder.php(90): Statamic\Data\Content\UrlBuilder->getSpecialValue('year')
#3 /var/www/statamic/core/Data/Content/UrlBuilder.php(49): Statamic\Data\Content\UrlBuilder->getValue('year')
#4 /var/www/statamic/core/Data/Entries/Entry.php(163): Statamic\Data\Content\UrlBuilder->build('/company/cultur...')
#5 /var/www/statamic/core/Data/Content/Content.php(172): Statamic\Data\Entries\Entry->uri()
#6 /var/www/statamic/core/Data/Content/Content.php(161): Statamic\Data\Content\Content->absoluteUrl()
#7 /var/www/statamic/core/StaticCaching/Invalidator.php(79): Statamic\Data\Content\Content->url()
#8 [internal function]: Statamic\StaticCaching\Invalidator->handle(Object(Statamic\Events\Stache\RepositoryItemInserted))
#9 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(347): call_user_func_array(Array, Array)
#10 [internal function]: Illuminate\Events\Dispatcher->Illuminate\Events\{closure}(Object(Statamic\Events\Stache\RepositoryItemInserted))
#11 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(221): call_user_func_array(Object(Closure), Array)
#12 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(355): Illuminate\Events\Dispatcher->fire('Statamic\\Events...', Array, false)
#13 /var/www/statamic/core/Stache/Repository.php(259): event(Object(Statamic\Events\Stache\RepositoryItemInserted))
#14 /var/www/statamic/core/Stache/AggregateRepository.php(258): Statamic\Stache\Repository->setItem('c48d7636-8f61-4...', Object(Statamic\Data\Entries\Entry))
#15 /var/www/statamic/core/Stache/Updater.php(262): Statamic\Stache\AggregateRepository->setItem('c48d7636-8f61-4...', Object(Statamic\Data\Entries\Entry))
#16 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Support/Collection.php(135): Statamic\Stache\Updater->Statamic\Stache\{closure}(Array, 0)
#17 /var/www/statamic/core/Stache/Updater.php(265): Illuminate\Support\Collection->each(Object(Closure))
#18 /var/www/statamic/core/Stache/Updater.php(278): Statamic\Stache\Updater->updateItems(Object(Illuminate\Support\Collection), 'biznet-cultures')
#19 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Support/Collection.php(135): Statamic\Stache\Updater->Statamic\Stache\{closure}(Object(Illuminate\Support\Collection), 'biznet-cultures')
#20 /var/www/statamic/core/Stache/Updater.php(295): Illuminate\Support\Collection->each(Object(Closure))
#21 /var/www/statamic/core/Stache/Updater.php(142): Statamic\Stache\Updater->updateAggregate()
#22 /var/www/statamic/core/Stache/Updater.php(110): Statamic\Stache\Updater->updateDefault()
#23 /var/www/statamic/core/Stache/UpdateManager.php(60): Statamic\Stache\Updater->update()
#24 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Support/Collection.php(135): Statamic\Stache\UpdateManager->Statamic\Stache\{closure}(Object(Statamic\Stache\Drivers\EntriesDriver), 'entries')
#25 /var/www/statamic/core/Stache/UpdateManager.php(68): Illuminate\Support\Collection->each(Object(Closure))
#26 /var/www/statamic/core/Stache/Manager.php(88): Statamic\Stache\UpdateManager->update()
#27 /var/www/statamic/core/Stache/Manager.php(77): Statamic\Stache\Manager->doUpdate()
#28 /var/www/statamic/core/Providers/StacheServiceProvider.php(173): Statamic\Stache\Manager->update()
#29 [internal function]: Statamic\Providers\StacheServiceProvider->boot(Object(Illuminate\Http\Request))
#30 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#31 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->call(Array)
#32 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(717): Illuminate\Foundation\Application->bootProvider(Object(Statamic\Providers\StacheServiceProvider))
#33 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Statamic\Providers\StacheServiceProvider), 30)
#34 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(718): array_walk(Array, Object(Closure))
#35 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#36 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Statamic\Application))
#37 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(222): Illuminate\Foundation\Application->bootstrapWith(Array)
#38 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(117): Illuminate\Foundation\Http\Kernel->bootstrap()
#39 /var/www/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#40 /var/www/index.php(167): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#41 {main}