Return null if the file doesn't exist

parent 55389831
......@@ -85,6 +85,10 @@ class MediaController extends Controller
$file = $this->file->find($imageable->file_id);
if ($file === null) {
return response()->json(['data' => null]);
}
return new MediaTransformer($file);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment