This bug was introduced with the commit "[Media] Fix issues with database file storage" due to the API change "File::getByHash now returns a yield of files". I had updated this function on that commit but had missed this little detail.