mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 22:46:49 +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).
22 lines
1.1 KiB
Text
22 lines
1.1 KiB
Text
@using BTCPayServer.Services.Altcoins.Monero.Configuration
|
|
@using BTCPayServer.Services.Altcoins.Monero.UI
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@using BTCPayServer.Client
|
|
@using BTCPayServer.Abstractions.TagHelpers
|
|
@using BTCPayServer.Abstractions.Contracts
|
|
@inject MoneroLikeConfiguration MoneroLikeConfiguration;
|
|
@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(UIMoneroLikeStoreController).StartsWith(controller.ToString() ?? string.Empty, StringComparison.InvariantCultureIgnoreCase);
|
|
}
|
|
@if (MoneroLikeConfiguration.MoneroLikeConfigurationItems.Any())
|
|
{
|
|
<li class="nav-item" permission="@Policies.CanModifyStoreSettings">
|
|
<a asp-action="GetStoreMoneroLikePaymentMethods" asp-controller="UIMoneroLikeStore" asp-route-storeId="@storeId" class="nav-link @(isActive ? "active" : string.Empty)" id="StoreNav-Monero">
|
|
<span class="me-2 btcpay-status"></span>
|
|
<span>Monero</span>
|
|
</a>
|
|
</li>
|
|
}
|