Smuggli has uploaded a new change for review.

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

Change subject: Fixed call on no object
......................................................................

Fixed call on no object

In some rare cases when no user object could be created fatal error
coccured

Change-Id: I1e96d4d54bdf65d47b0c75269bcb070564ff3e16
---
M ContextMenu/ContextMenu.class.php
1 file changed, 8 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/75/159075/1

diff --git a/ContextMenu/ContextMenu.class.php 
b/ContextMenu/ContextMenu.class.php
index 9189be1..f662ddb 100644
--- a/ContextMenu/ContextMenu.class.php
+++ b/ContextMenu/ContextMenu.class.php
@@ -135,13 +135,15 @@
        public function onLinkEnd( $skin, $target, $options, &$html, &$attribs, 
&$ret ) {
                if( $target->getNamespace() == NS_USER && $target->isSubpage() 
=== false ) {
                        $oUser = User::newFromName($target->getText());
-                       $sMailAddress = $oUser->getEmail();
-                       $attribs['data-bs-user-has-email']
-                               = empty( $sMailAddress ) ? false : true ;
+                       if ( $oUser instanceof User ) {
+                               $sMailAddress = $oUser->getEmail();
+                               $attribs['data-bs-user-has-email']
+                                       = empty( $sMailAddress ) ? false : true 
;
 
-                       //This is already in BSF, but it is only included when 
the anchor
-                       //content is the same as the username
-                       $attribs['data-bs-username'] = $target->getText();
+                               //This is already in BSF, but it is only 
included when the anchor
+                               //content is the same as the username
+                               $attribs['data-bs-username'] = 
$target->getText();
+                       }
                }
                if( $target->getNamespace() >= 0 && $target->isContentPage() ) {
                        $attribs['data-bs-is-contentpage'] = true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e96d4d54bdf65d47b0c75269bcb070564ff3e16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Smuggli <[email protected]>

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

Reply via email to