Don't fail fatally when Linker::link() is passed a non-object
[lhc/web/wiklou.git] / includes / Linker.php
index cc02241..aa21f90 100644 (file)
@@ -178,7 +178,7 @@ class Linker {
                }
 
                if( !$target instanceof Title ) {
-                       throw new MWException( 'Linker::link passed invalid target' );
+                       return "<!-- ERROR -->$text";
                }
                $options = (array)$options;