Error in decision block when no block is selected

Created on 14 February 2023, almost 2 years ago

Problem/Motivation

If a decision block has no block selected, the error is:
'Error: Call to a member function getPluginId() on null in Drupal\smart_content_block\Plugin\Block\DecisionBlock->build() (line 107 of modules/contrib/smart_content/modules/smart_content_block/src/Plugin/Block/DecisionBlock.php).'

Steps to reproduce

Create a smart content block, with no decision block->View page.

Proposed resolution

Do a null check on the object before attempting to call function.

User interface changes

None

Have attached a patch, might require re-rolling. But it does work for us.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇳🇿New Zealand atowl

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

Comments & Activities

Production build 0.71.5 2024