Skip to content

Commit e2fdc5f

Browse files
author
xalberteinsteinx
committed
Adds checking on empty in GetImageBehavior's get() method.
1 parent aebb345 commit e2fdc5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

behaviors/GetImageBehavior.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get($category, $type, $name)
3838
$directory = \Yii::getAlias($this->owner->imagesPath);
3939
$imagePath = implode(DIRECTORY_SEPARATOR, [$directory, $category]);
4040
$images = glob($imagePath . DIRECTORY_SEPARATOR . "$name-$type.*");
41-
if ($images === false) {
41+
if (empty($images)) {
4242
return false;
4343
}
4444
/* Get the first matched file. */

0 commit comments

Comments
 (0)