* Check whether external edit or diff should be used.
*
* @param $context IContextSource context to use
- * @param $type String can be either 'edit' or 'diff'
+ * @param string $type can be either 'edit' or 'diff'
* @return Bool
*/
public static function useExternalEngine( IContextSource $context, $type ) {
} 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