Skip to content

Commit

Permalink
addon might be null
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Dec 21, 2020
1 parent 48eb0d8 commit 8d2afe4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/FormaAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class FormaAddon
{
private Addon $addon;
private ?Addon $addon;
private string $controller;

public function __construct(string $package, ?string $controller)
Expand All @@ -38,6 +38,10 @@ private function bootNav()

private function registerRoutes()
{
if (! $this->addon) {
return;
}

Statamic::pushCpRoutes(function () {
Route::name($this->addon->handle())->prefix('{handle}')->group(function () {
Route::name('.config.')->prefix('config')->group(function () {
Expand Down

0 comments on commit 8d2afe4

Please sign in to comment.