variant.GetUrl return exception on generating feed from ashx

I’m trying to get url of variants from a background service.
variant.GetUrl always return with exception.
When checked in detail, its from UrlServiceImpl,
_routeRequestLookupInfoAccessor.RouteRequestLookupInfo.IsInAdministration is causing exception as
RouteRequestLookupInfo is null.

Is there any other way to get variant url?

Litium version: 7

What is the exact version number and can you provide the error-message including stacktrace. Thanks.

Version : (7.2.0-patch-1903151914)

Object reference not set to an instance of an object.
at Litium.Application.Web.UrlServiceImpl.GetUrl(Variant variant, ProductUrlArgs args)
at Litium.Accelerator.Mvc.App_Start.UrlServiceDecorator.GetUrl(Variant variant, ProductUrlArgs args) in Litium.Accelerator.Mvc\App_Start\UrlServiceDecorator.cs:line 53
at Litium.Foundation.Modules.ExtensionMethods.VariantExtensions.GetUrl(Variant arg, Boolean absoluteUrl, Category currentCategory, Nullable`1 channelSystemId)

Are you sending in an existing variant and setting the ProductUrlArgs from your implementation of Litium.Accelerator.Mvc\App_Start\UrlServiceDecorator.cs?

Yes. An existing variant. ProductUrlArgs have all the details, except websitesystemid (Its Guid.Empty) and Category(its null)
On decorator, the first line is
var url = _parent.GetUrl(variant, args); which is returning exception

Please, apply the released 7.2.0 version, it should be fixed in that version.

1 Like