Copied to clipboard

Flag this post as spam?

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


  • Jace Maniquis 6 posts 92 karma points
    Jun 16, 2020 @ 15:36
    Jace Maniquis
    0

    Does GetCropUrl always throw exception if file is not existing on physical path?

    We encounter the following error on 8.0.2. is it handled on earlier version/s?

    System.ArgumentNullException: Value cannot be null. Parameter name: mediaItem

  • Lars-Erik Aabech 349 posts 1100 karma points MVP 8x c-trib
    Jun 17, 2020 @ 06:48
    Lars-Erik Aabech
    0

    Hi Jace,

    [This is just a dupe of my answer on slack, but pasting here in case someone else finds the question via search.]

    GetCropUrl in itself is just a string building mechanism. There are overloads that look for a file path in the umbracoFile property on an IPublishedContent representing the media. If that's null, GetCropUrl would likely throw a NullReferenceException.

    The resulting URL would also need to "find something". Here's a couple of useful links describing how Umbraco finds the files:

    https://our.umbraco.com/Documentation/Extending/FileSystemProviders/
    https://our.umbraco.com/Documentation/Extending/FileSystemProviders/Azure-Blob-Storage/

    HTH,
    Lars-Erik

Please Sign in or register to post replies

Write your reply to:

Draft