Drop the UserLoadFromSession hook, deprecated in 1.27
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderImage.php
index 2e2da70..c1b3dc3 100644 (file)
@@ -146,6 +146,7 @@ class ResourceLoaderImage {
         *
         * @param ResourceLoaderContext $context Any context
         * @return string
+        * @throws MWException If no matching path is found
         */
        public function getPath( ResourceLoaderContext $context ) {
                $desc = $this->descriptor;
@@ -167,7 +168,11 @@ class ResourceLoaderImage {
                if ( isset( $desc[$context->getDirection()] ) ) {
                        return $this->basePath . '/' . $desc[$context->getDirection()];
                }
-               return $this->basePath . '/' . $desc['default'];
+               if ( isset( $desc['default'] ) ) {
+                       return $this->basePath . '/' . $desc['default'];
+               } else {
+                       throw new MWException( 'No matching path found' );
+               }
        }
 
        /**