From: Reedy Date: Sat, 28 Apr 2012 00:21:42 +0000 (+0100) Subject: Fatal error: Call to a member function getExtension() on a non-object in /usr/local... X-Git-Tag: 1.31.0-rc.0~23790^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=8b60be946b5adcf8cd08f1ba93db59364df15d48;p=lhc%2Fweb%2Fwiklou.git Fatal error: Call to a member function getExtension() on a non-object in /usr/local/apache/common-local/php-1.20wmf1/includes/ExternalEdit.php on line 84 Change-Id: I9e54204ebac69dc0e8682b502cee8ec43ff2d9a4 --- diff --git a/includes/ExternalEdit.php b/includes/ExternalEdit.php index b8704758bc..346832538c 100644 --- a/includes/ExternalEdit.php +++ b/includes/ExternalEdit.php @@ -80,10 +80,16 @@ class ExternalEdit extends ContextSource { } elseif ( $this->getRequest()->getVal( 'mode' ) == 'file' ) { $type = "Edit file"; $image = wfLocalFile( $this->getTitle() ); - $urls = array( 'File' => array( - 'Extension' => $image->getExtension(), - 'URL' => $image->getCanonicalURL() - ) ); + if ( $image ) { + $urls = array( + 'File' => array( + 'Extension' => $image->getExtension(), + 'URL' => $image->getCanonicalURL() + ) + ); + } else{ + $urls = array(); + } } else { $type = "Edit text"; # *.wiki file extension is used by some editors for syntax