Merge "API: Make jsonfm the default output format"
[lhc/web/wiklou.git] / includes / media / DjVuImage.php
index 6ff19c9..596d3e8 100644 (file)
@@ -265,12 +265,16 @@ class DjVuImage {
 
        /**
         * Return an XML string describing the DjVu image
-        * @return string
+        * @return string|bool
         */
        function retrieveMetaData() {
                global $wgDjvuToXML, $wgDjvuDump, $wgDjvuTxt;
                wfProfileIn( __METHOD__ );
 
+               if ( !$this->isValid() ) {
+                       return false;
+               }
+
                if ( isset( $wgDjvuDump ) ) {
                        # djvudump is faster as of version 3.5
                        # http://sourceforge.net/tracker/index.php?func=detail&aid=1704049&group_id=32953&atid=406583