mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 06:34:04 +00:00
Handle null case explicitly
This commit is contained in:
parent
bf6ef4a4b9
commit
2ae984f176
1 changed files with 4 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||||
namespace Stancl\Tenancy\Controllers;
|
namespace Stancl\Tenancy\Controllers;
|
||||||
|
|
||||||
use Illuminate\Routing\Controller;
|
use Illuminate\Routing\Controller;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
class TenantAssetsController extends Controller
|
class TenantAssetsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
@ -17,9 +18,11 @@ class TenantAssetsController extends Controller
|
||||||
|
|
||||||
public function asset($path = null)
|
public function asset($path = null)
|
||||||
{
|
{
|
||||||
|
abort_if(is_null($path), 404);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return response()->file(storage_path("app/public/$path"));
|
return response()->file(storage_path("app/public/$path"));
|
||||||
} catch (\Throwable $th) {
|
} catch (Throwable $th) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue