From 1de7a136f6f0fc346e2d9f6eec2cf6ca81405b78 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 7 Oct 2022 06:16:54 -0600 Subject: [PATCH] Update MediaStorageService --- app/Services/MediaStorageService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/MediaStorageService.php b/app/Services/MediaStorageService.php index e252aacf6..ca1e93e4a 100644 --- a/app/Services/MediaStorageService.php +++ b/app/Services/MediaStorageService.php @@ -236,7 +236,10 @@ class MediaStorageService { $tmpBase = storage_path('app/remcache/'); $tmpPath = 'avatar_' . $avatar->profile_id . '-' . $path; $tmpName = $tmpBase . $tmpPath; - $data = file_get_contents($url, false, null, 0, $head['length']); + $data = @file_get_contents($url, false, null, 0, $head['length']); + if(!$data) { + return; + } file_put_contents($tmpName, $data); $disk = Storage::disk($driver);