Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jun 27, 2017 @ 23:44
    Nathan Woulfe
    0

    MultiUrlPicker null reference error when indexing Archetype content

    Trying to resolve an issue where I'm getting an intermittent error in a content indexer - we're using Archetype quite extensively, and parse the content into a custom index along with data from other fields.

    This works fine, but on occasion I'm getting a null reference error from RJP.MultiUrlPicker, when attempting to deserialize a property to an Archetype model:

    var columnContent = JsonConvert.DeserializeObject<ArchetypeModel>(archetype.GetValue<string>("column")).Select(c => c.GetValue<string>("content"));
    

    The content property is an RTE field, containing the data I want to index. It has a value. Elsewhere on the column model is a property using the MultiUrlPicker data type, it is empty. It's not referenced anywhere in my code, if just happens to exist on the same Archetype model.

    If I publish the page 10 times, 2 might throw the null reference error. I'm catching the exception, so it's not breaking anything, but it does mean that some changes may not be indexed.

    Any ideas/suggestions as to why this would be happening?

  • Comment author was deleted

    Jun 28, 2017 @ 00:46

    Sounds like a real toughie to be honest. Out of curiosity can you try publishing 10 times but slowly?

    My gut tells me that the model isn't fully finished loading before it is saved perhaps.

    Totally guessing of course but nothing came to top of mind otherwise.

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Jun 28, 2017 @ 07:04
    Nathan Woulfe
    0

    Yeah, it seems a bit odd. Being intermittent makes it painful to try and debug too, then when it does throw, the trace is pretty useless.

    Haven't tried saving first, then publishing either - not that I'd see that making much difference as the indexing is happening on the publish event, but never know...

    Will try adding a bit of sleepy time to see if it's loading related.

    Not super concerned, but would be nice to solve just the same.

Please Sign in or register to post replies

Write your reply to:

Draft