From: Brion Vibber Date: Thu, 23 Dec 2004 04:54:48 +0000 (+0000) Subject: * Avoid PHP warning messages when thumbnail not generated X-Git-Tag: 1.5.0alpha1~1051 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=45be19b5260a85a734aab711995e23b85c4f13a8;p=lhc%2Fweb%2Fwiklou.git * Avoid PHP warning messages when thumbnail not generated --- diff --git a/includes/Image.php b/includes/Image.php index 6445453480..51cbf29fa2 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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