* Avoid PHP warning messages when thumbnail not generated
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 23 Dec 2004 04:54:48 +0000 (04:54 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 23 Dec 2004 04:54:48 +0000 (04:54 +0000)
includes/Image.php

index 6445453..51cbf29 100644 (file)
@@ -506,10 +506,11 @@ class Image
                        # Check for zero-sized thumbnails. Those can be generated when 
                        # no disk space is available or some other error occurs
                        #
-                       $thumbstat = stat( $thumbPath );
-                       if( $thumbstat['size'] == 0 )
-                       {
-                               unlink( $thumbPath );
+                       if( file_exists( $thumbstat ) ) {
+                               $thumbstat = stat( $thumbPath );
+                               if( $thumbstat['size'] == 0 ) {
+                                       unlink( $thumbPath );
+                               }
                        }
 
                        # Purge squid