mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-28 08:10:45 +00:00
fix(core): 🐛 handle null exception for user group
This commit is contained in:
parent
3be7e86926
commit
081a176edc
|
@ -117,17 +117,19 @@ final class Header extends Partial {
|
||||||
foreach ( $groups as $group ) {
|
foreach ( $groups as $group ) {
|
||||||
$id = sprintf( $msgName, $group );
|
$id = sprintf( $msgName, $group );
|
||||||
$msg = $this->skin->msg( $id )->text();
|
$msg = $this->skin->msg( $id )->text();
|
||||||
// Nullpointer should not happen
|
$title = $this->title->newFromText(
|
||||||
$href = $this->title->newFromText(
|
|
||||||
$this->skin->msg( sprintf( $msgName, $group ) )->text(),
|
$this->skin->msg( sprintf( $msgName, $group ) )->text(),
|
||||||
NS_PROJECT
|
NS_PROJECT
|
||||||
)->getLinkURL();
|
);
|
||||||
|
if ( $title ) {
|
||||||
|
$href = $title->getLinkURL();
|
||||||
$html .= <<< HTML
|
$html .= <<< HTML
|
||||||
<li>
|
<li>
|
||||||
<a href="$href" id="$id">$msg</a>
|
<a href="$href" id="$id">$msg</a>
|
||||||
</li>
|
</li>
|
||||||
HTML;
|
HTML;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$html = sprintf( '<li id="pt-usergroups"><ul>%s</ul></li>', $html );
|
$html = sprintf( '<li id="pt-usergroups"><ul>%s</ul></li>', $html );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue