[CFGUI-77] NPE when area as no availableComponents Created: 23/May/18  Updated: 29/Mar/19  Resolved: 29/Mar/19

Status: Closed
Project: Definitions App
Component/s: None
Affects Version/s: 1.1.3
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Will Scheidegger Assignee: Milan Divilek
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h

Issue Links:
duplicate
duplicates MAGNOLIA-7351 Setting a property to null via YAML c... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Testcase included:
Yes

 Description   

Problem

When a template definition defines an area with no available components, then the "problems" sub app of the definition app will not start up, because of an NPE in TemplateDefinitionValidator line 97. areaDefinition.getAvailableComponents() returns null here, but it's not checked.

Especially a class like the TemplateDefinitionValidator should be very robust towards invalid or senseless template definitions.

 

Testcase

This template definition will crash the definitions app:

class: info.magnolia.module.site.templates.PageTemplateDefinition

renderType: site
type: feature

parameters:
  allowedSubTemplates:

areas:
  main:
    type: list
    availableComponents:
  footer:
    editable: false

Generated at Mon Feb 12 00:44:47 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.