mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 14:50:50 +01:00
They failed with an `System.NullReferenceException: Object reference not set to an instance of an object.` when navigating to a LNbank page, because LNbank uses Razor Pages and the controller part wan't defined. Brought up [on Mattermost](https://chat.btcpayserver.org/btcpayserver/pl/x3iohhct97nateyq4y1c4hp9mw).
16 lines
1,020 B
Text
16 lines
1,020 B
Text
@using BTCPayServer.Services.Altcoins.Zcash.Configuration
|
|
@using BTCPayServer.Services.Altcoins.Zcash.UI
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@using BTCPayServer.Abstractions.Contracts
|
|
@inject SignInManager<ApplicationUser> SignInManager;
|
|
@inject ZcashLikeConfiguration ZcashLikeConfiguration;
|
|
@inject IScopeProvider ScopeProvider
|
|
@{
|
|
var storeId = ScopeProvider.GetCurrentStoreId();
|
|
var isActive = !string.IsNullOrEmpty(storeId) && ViewContext.RouteData.Values.TryGetValue("Controller", out var controller) && controller is not null &&
|
|
nameof(UIZcashLikeStoreController).StartsWith(controller.ToString() ?? string.Empty, StringComparison.InvariantCultureIgnoreCase);
|
|
}
|
|
@if (SignInManager.IsSignedIn(User) && User.IsInRole(Roles.ServerAdmin) && ZcashLikeConfiguration.ZcashLikeConfigurationItems.Any())
|
|
{
|
|
<a class="nav-link @(isActive ? "active" : string.Empty)" asp-route-storeId="@storeId" asp-action="GetStoreZcashLikePaymentMethods" asp-controller="UIZcashLikeStore">Zcash</a>
|
|
}
|