Skip to content

Commit

Permalink
Early return if no asset is found
Browse files Browse the repository at this point in the history
  • Loading branch information
inietov committed Aug 30, 2023
1 parent c0cbdb1 commit 085a993
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/View/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public function render(callable $callback = null)
$assets = $this->data->get('assets');
$offset = $this->data->get('offset');
$template = $this->data->get('template');

if ($assets->isEmpty()){
return redirect()->back();
}

// If disabled, pass to legacy view
if ((!$settings->label2_enable) && (!$template)) {
Expand Down

0 comments on commit 085a993

Please sign in to comment.