RWS / dxa-content-management

SDL Digital Experience Accelerator CM-side framework (.NET Template Building Blocks)
Apache License 2.0
6 stars 18 forks source link

The Publish Settings TBB Crash on empty Publication Metadataschema #23

Open RaimondKempees opened 6 years ago

RaimondKempees commented 6 years ago

Just had an issue whereby a publication apparently had Metadata, but not an assigned MetadataSchema. This then gave an NPE here: https://github.com/sdl/dxa-content-management/blob/develop/Sdl.Web.Tridion.Templates/Templates/PublishConfiguration.cs#L277 and further a startPublication.MetadataSchema is null.

So, I think an extra check on the nullness of MetadataSchema on startPublication is needed.

rpannekoek commented 5 years ago

On which DXA version was this observed? Above URL points to develop branch, so what's currently on line 277 may not match what was there on the system where this problem occurred.

I don't understand how a Publication.MetadataSchema = null could result in a NullReferenceException on the given line (since there is a null check).