- Issue created by @BenStallings
\Drupal\rjsf\Plugin\Field\FieldFormatter\RjsfEditorFormatter::viewElements() is defined by \Drupal\Core\Field\FormatterInterface as returning an array, but the return variable $elements is only defined within a foreach loop, so if $items contains no items, the variable will be undefined and the method will return null instead of an array, causing an error.
Honestly this lack of $items probably only happens if an entity is created programmatically and not through the UI, but it's still a bug in the code.
Define $elements = [];
before the foreach loop.
Make a MR.
Active
1.0
Code