Change-Id: I9e54204ebac69dc0e8682b502cee8ec43ff2d9a4
} 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