Fixes a NullReferenceException bug when the ValueSetValidator is null#16379
Fixes a NullReferenceException bug when the ValueSetValidator is null#16379Matthew-Wise merged 1 commit intoumbraco:contribfrom
Conversation
…llReferenceException. Fixes a bug where the ValueSetValidator is null which will cause a NullReferenceException.
|
Hi there @Shazwazza, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
|
Hey @Shazwazza! Thanks a lot for your PR, someone on the core collaborators team will review this soon 😸 |
|
Hi @Shazwazza Confirmed working and what a sneaky bug, from a user point of view it all works but you can see the null ref in the logs. Thanks |
Fixes a bug where the ValueSetValidator is null which will cause a NullReferenceException.
Prerequisites
Description
When creating a custom index based on Umbraco content/media via this code:
It will mean that this index's
LuceneDirectoryIndexOptions.ValueSetValidatorwill be null and when rebuilding the index, a null reference exception will occur.To resolve this, it is required that an explicit value set validator is applied to the options, like:
However, it is not clear that this is a requirement but either way, a null reference exception shouldn't be thrown.
A reference: SDKits/ExamineX#103 (comment)