Mglaser has uploaded a new change for review. https://gerrit.wikimedia.org/r/312238
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(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/38/312238/1 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: newchange Gerrit-Change-Id: I7fbebd2e34258742e6080cdd7f307a058c4d7a35 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Mglaser <gla...@hallowelt.biz> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits