Fix issue displaying protected file thumbnails when width or height is empty.

Related #5267
This commit is contained in:
Luke Towers 2020-09-07 15:23:00 -06:00
parent 1ef50d4751
commit ce47c0248f
1 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,9 @@ class File extends FileBase
public function getThumb($width, $height, $options = [])
{
$url = '';
$width = !empty($width) ? $width : 0;
$height = !empty($height) ? $height : 0;
if (!$this->isPublic() && class_exists(Files::class)) {
$options = $this->getDefaultThumbOptions($options);
// Ensure that the thumb exists first