Bsitu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67324


Change subject: $wgOut->getContext()->getTitle() may return null
......................................................................

$wgOut->getContext()->getTitle() may return null

We should just check if it's null before using it as a title object

Change-Id: Ieaf7adb3fccc62c79a6eaad5650840cc5411873e
---
M Hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/24/67324/1

diff --git a/Hooks.php b/Hooks.php
index 2c3b76d..1fec954 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -801,7 +801,7 @@
                $context = $wgOut->getContext();
 
                // Capture user options saved via Special:Preferences or 
ApiOptions
-               if ( $context->getTitle()->isSpecial( 'Preferences' )
+               if ( ( $context->getTitle() && $context->getTitle()->isSpecial( 
'Preferences' ) )
                        || ( defined( 'MW_API' ) && 
$context->getRequest()->getVal( 'action' ) === 'options' )
                ) {
                        // $clone is the current user object with the new 
option value not set

-- 
To view, visit https://gerrit.wikimedia.org/r/67324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaf7adb3fccc62c79a6eaad5650840cc5411873e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to