jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Kaldari: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: Ieaf7adb3fccc62c79a6eaad5650840cc5411873e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to