From cfca9e9841254ef4b78541633aa527ef2e233a8b Mon Sep 17 00:00:00 2001 From: Callum Whyte Date: Fri, 27 May 2022 01:38:28 +0100 Subject: [PATCH] Data types are null when being created, defend legacy value converter from nulls --- CHANGELOG.md | 12 +++++++++++- .../Migrations/LegacyDataTypeChangingHandler.cs | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b22819..899de46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/). +## [3.0.3] - 2022-05-27 +### Fixed +* Unable to create new Meganav properties due to null data type + ## [3.0.2] - 2022-05-23 ### Fixed * `meganav-card` styles breaking backoffice minification @@ -24,6 +28,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this * Actions to expand / collapse Meganav, and populate with all nodes from the tree * UI overhaul with improved accessibility +## [2.0.3] - 2022-05-27 +### Fixed +* Unable to create new Meganav properties due to null data type + ## [2.0.2] - 2022-05-23 ### Fixed * `meganav-card` styles breaking backoffice minification @@ -78,10 +86,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this ### Added * Initial release of Meganav for Umbraco 7.5 -[Unreleased]: https://github.com/callumbwhyte/meganav/compare/release-3.0.2...HEAD +[Unreleased]: https://github.com/callumbwhyte/meganav/compare/release-3.0.3...HEAD +[3.0.3]: https://github.com/callumbwhyte/meganav/compare/release-3.0.2...release-3.0.3 [3.0.2]: https://github.com/callumbwhyte/meganav/compare/release-3.0.1...release-3.0.2 [3.0.1]: https://github.com/callumbwhyte/meganav/compare/release-3.0.0...release-3.0.1 [3.0.0]: https://github.com/callumbwhyte/meganav/compare/release-2.0.0...release-3.0.0 +[2.0.3]: https://github.com/callumbwhyte/meganav/compare/release-2.0.2...release-2.0.3 [2.0.2]: https://github.com/callumbwhyte/meganav/compare/release-2.0.1...release-2.0.2 [2.0.1]: https://github.com/callumbwhyte/meganav/compare/release-2.0.0...release-2.0.1 [2.0.0]: https://github.com/callumbwhyte/meganav/tree/release-2.0.0 diff --git a/src/Our.Umbraco.Meganav/Migrations/LegacyDataTypeChangingHandler.cs b/src/Our.Umbraco.Meganav/Migrations/LegacyDataTypeChangingHandler.cs index d4bc699..369a0fc 100644 --- a/src/Our.Umbraco.Meganav/Migrations/LegacyDataTypeChangingHandler.cs +++ b/src/Our.Umbraco.Meganav/Migrations/LegacyDataTypeChangingHandler.cs @@ -25,7 +25,9 @@ public void Handle(DataTypeSavingNotification notification) { var existingEntity = _dataTypeService.GetDataType(x.Id); - return existingEntity?.EditorAlias != Constants.PropertyEditorAlias && LegacyEditors.Aliases.Any(existingEntity.EditorAlias.InvariantContains); + return existingEntity != null + && existingEntity.EditorAlias != Constants.PropertyEditorAlias + && LegacyEditors.Aliases.Any(existingEntity.EditorAlias.InvariantContains); }); foreach (var dataType in dataTypes)