Fix error handling in File::createThumb.
authorBrian Wolff <bawolff+wn@gmail.com>
Fri, 13 Dec 2013 08:54:20 +0000 (01:54 -0700)
committerBrian Wolff <bawolff+wn@gmail.com>
Fri, 13 Dec 2013 08:54:20 +0000 (01:54 -0700)
Was checking for null, but transform always returns either
false or an object.

createThumb isn't used in core, but some extensions use it.

Bug: 58436
Change-Id: Icaf5088a193dc1d9b9c365f92722bef1f9c1dba6

includes/filerepo/file/File.php

index 1c9d8aa..dc35016 100644 (file)
@@ -904,7 +904,7 @@ abstract class File {
                        $params['height'] = $height;
                }
                $thumb = $this->transform( $params );
-               if ( is_null( $thumb ) || $thumb->isError() ) {
+               if ( !$thumb || $thumb->isError() ) {
                        return '';
                }