-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NRE with TaxonomyIndex #11283
Fix NRE with TaxonomyIndex #11283
Conversation
When a Taxonomy Field is removed from a Content Type. Cloning the content item may fail with an NRE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @Skrypt, turns out it has nothing to do with the removed taxonomy field. The index runs while cloning, right after an empty content item was created (so before the.actual cloning). The fields are there, but all ´null´. Casting this to JObject fails, as null is a JValue. I locally fixed this by changing
to
|
Yes, I think this would work still with fewer lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good!
My two cents, does not look as though it is an |
We are looping inside a collection of fieldDefinition so it is impossible that the object be null else it would not be part of the IEnumerable. |
When a Taxonomy Field is removed from a Content Type. Cloning the content item may fail with an NRE.
/cc @ns8482e