Skip to content

Commit 3df1ee2

Browse files
authored
Fix TypeError failing CI (#108)
TypeError: SMW\Localizer\Localizer::asBCP47FormattedLanguageCode(): Argument #1 ($languageCode) must be of type string, null given, called in /var/www/html/extensions/SemanticInterlanguageLinks/src/Search/SearchResultModifier.php on line 148
1 parent f3c79fc commit 3df1ee2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Search/SearchResultModifier.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ public function applyLanguageFilterToResultMatches( $request, &$titleMatches, &$
145145
return false;
146146
}
147147

148-
$languageCode = Localizer::asBCP47FormattedLanguageCode( $request->getVal( 'languagefilter' ) );
148+
$languageCode = Localizer::asBCP47FormattedLanguageCode(
149+
$request->getVal( 'languagefilter' ) ?? ''
150+
);
149151

150152
if ( in_array( $languageCode, [ null, '', '-' ] ) ) {
151153
return false;

0 commit comments

Comments
 (0)