Skip to content

Commit

Permalink
Merge pull request #3281 from spatie/bug/3279-class-not-found
Browse files Browse the repository at this point in the history
Bug/3279 class not found
  • Loading branch information
Nielsvanpach authored Jun 6, 2023
2 parents 43f32a4 + 388bb78 commit 22581bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Conversions/ConversionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ protected function addConversionsFromRelatedModel(Media $media): void
$modelName = Arr::get(Relation::morphMap(), $media->model_type, $media->model_type);

/** @var \Spatie\MediaLibrary\HasMedia $model */
$model = new $modelName();
if (class_exists($modelName)) {
$model = new $modelName();
}

/*
* In some cases the user might want to get the actual model
Expand Down
2 changes: 2 additions & 0 deletions src/Downloaders/DefaultDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function getTempFile(string $url): string

file_put_contents($temporaryFile, $stream);

fclose($stream);

return $temporaryFile;
}
}

0 comments on commit 22581bc

Please sign in to comment.