Copied to clipboard

Flag this post as spam?

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


  • suzyb 474 posts 932 karma points
    May 09, 2014 @ 17:52
    suzyb
    0

    Error when post(s) don't have tags or labels

    I'm getting an "Object reference not set to an instance of an object." error when my post doesn't have any tags or labels associated with them.

    If a post doesn't have any tags the error is related to the GetTags method of PostService, when the post does and the code gets beyond that line an error occurs on GetLabels.

    As my posts don't have tags or labels how can I fix this problem.

  • suzyb 474 posts 932 karma points
    May 15, 2014 @ 19:49
    suzyb
    0

    The error seems to be happening because the peoperty isn't saved if it is empty.

    I've downloaded the source and updated GetIdsFromCsvProperty as follows until an official update.

    if (node.GetProperty(propertyAlias) != null && node.GetPropertyValue(propertyAlias) != null)
    {
           // get from given node
           nodeIds = node.GetPropertyValue<string>(propertyAlias)
                                    .Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList();
    }

     

Please Sign in or register to post replies

Write your reply to:

Draft