Skip to content

Commit 54799cf

Browse files
committed
fix if no preview token available
1 parent 3f8d253 commit 54799cf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Livewire/PreviewTemplate.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ public function mount(Request $request): void
2525
#[Layout('mailcarrier::livewire.layout')]
2626
public function render(Preview $preview): string
2727
{
28-
$content = $preview->run(Cache::get('preview:' . $this->token));
28+
if (!$previewContent = Cache::get('preview:' . $this->token)) {
29+
return '<div></div>';
30+
}
31+
32+
$content = $preview->run($previewContent);
2933

3034
return <<<HTML
3135
<div wire:poll.1s>

0 commit comments

Comments
 (0)