Skip to content

Commit 19928fb

Browse files
authored
Merge pull request #122 from juzaweb/fix/null-theme-thumbnail-error-17052108890914793362
Fix Call to a member function thumbnailUrl() on null khi ko có theme
2 parents 65148b0 + 9b8d064 commit 19928fb

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Http/Controllers/Admin/ThemeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function loadData(Request $request)
3232
}
3333

3434
$currentTheme = Theme::current();
35-
$themes = Theme::all()->filter(fn ($theme) => $theme->name() !== $currentTheme->name());
35+
$themes = Theme::all()->filter(fn ($theme) => $theme->name() !== $currentTheme?->name());
3636

3737
return $this->success(
3838
[

src/resources/views/admin/theme/index.blade.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242
</div>
4343

4444
<div class="row" id="theme-list">
45-
<div class="col-md-4 p-2 theme-list-item">
46-
@component('core::admin.theme.components.theme-item', ['theme' => $currentTheme, 'active' => true])
45+
@if ($currentTheme)
46+
<div class="col-md-4 p-2 theme-list-item">
47+
@component('core::admin.theme.components.theme-item', ['theme' => $currentTheme, 'active' => true])
4748

48-
@endcomponent
49-
</div>
49+
@endcomponent
50+
</div>
51+
@endif
5052
</div>
5153
@endsection
5254

0 commit comments

Comments
 (0)