->getname() is called on $link['language'] = NULL

Created on 19 February 2022, over 2 years ago
Updated 2 April 2023, about 1 year ago

I configured the block to use "native name"

This caused the following error:
[19-Feb-2022 04:30:07] Error: Call to a member function getName() on null in C:\wamp64\www\***\web\modules\contrib\dropdown_language\src\Plugin\Block\DropdownLanguage.php on line 176 #0 C:\wamp64\www\***\web\core\modules\block\src\BlockViewBuilder.php(171): Drupal\dropdown_language\Plugin\Block\DropdownLanguage->build()

adding a Null check on link[language] at line 176 solved the issue:
if($link['language'] != Null) { $name = $link['language']->getName(); }

πŸ› Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

πŸ‡ΉπŸ‡­Thailand manarak

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024