1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 22:44:05 +00:00

Handle null case explicitly

This commit is contained in:
Bram Wubs 2022-07-20 20:03:52 +02:00
parent bf6ef4a4b9
commit 2ae984f176

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Controllers;
use Illuminate\Routing\Controller;
use Throwable;
class TenantAssetsController extends Controller
{
@ -17,9 +18,11 @@ class TenantAssetsController extends Controller
public function asset($path = null)
{
abort_if(is_null($path), 404);
try {
return response()->file(storage_path("app/public/$path"));
} catch (\Throwable $th) {
} catch (Throwable $th) {
abort(404);
}
}