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

Change subject: Avatars: Prevent fatal when repo cannot be found
......................................................................


Avatars: Prevent fatal when repo cannot be found

When the repo cannot be found, no file object is returned. This commit
prevents a fatal error in this case and returns an empty string instead

Change-Id: I7fbebd2e34258742e6080cdd7f307a058c4d7a35
---
M Avatars/Avatars.class.php
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/Avatars/Avatars.class.php b/Avatars/Avatars.class.php
index 9501a3c..a1218c9 100644
--- a/Avatars/Avatars.class.php
+++ b/Avatars/Avatars.class.php
@@ -184,6 +184,11 @@
                # TODO: Check if this is more expensive than a simple 
file_exists()
                $oFile = 
BsFileSystemHelper::getFileFromRepoName($sAvatarFileName, 'Avatars');
 
+               // Prevent fatal when filerepo cannot be found.
+               if ( !$oFile ) {
+                       return '';
+               }
+
                # If avatar doesn't yet exit, create one
                if (!$oFile->exists() || $bOverwrite) {
                        $sGenerator = BsConfig::get('MW::Avatars::Generator');

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7fbebd2e34258742e6080cdd7f307a058c4d7a35
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to