Fix to crash when the store don't have a wallet and a default payment method set

This commit is contained in:
Adil El Farissi
2024-11-02 21:46:29 +00:00
parent d040957a5d
commit 227beecc66
3 changed files with 6 additions and 5 deletions
@@ -7,7 +7,7 @@
<PropertyGroup>
<Product>OpenSimulator Plugin For BTCPay</Product>
<Description>The OpenSimulator Plugin implement a permissioned public interface to allow safe interactions with the OpenSimulator's virtual worlds LSL scripted objects without exposing sensive data like the Greenfield API keys.</Description>
<Version>0.1.2</Version>
<Version>0.1.2.1</Version>
</PropertyGroup>
<!-- Plugin development properties -->
@@ -28,10 +28,11 @@ public class UIOpenSimulatorController : Controller
public async Task<IActionResult> Index()
{
var data = await _OpenSimulatorService.GetAuthorizations(HttpContext.GetCurrentStoreId());
return View(new OpenSimulatorPageViewModel {
Data = data,
StoreID = HttpContext.GetCurrentStoreId(),
StoreDefaultPaymetMethod = HttpContext.GetStoreData().GetDefaultPaymentId().ToString(),
StoreDefaultPaymetMethod = HttpContext.GetStoreData().GetDefaultPaymentId()?.ToStringNormalized(),
StoreDefaultCurrency = HttpContext.GetStoreData().GetStoreBlob().DefaultCurrency,
ServerIP = HttpContext.Connection.LocalIpAddress.ToString()
});
@@ -131,7 +131,7 @@ $("#scriptsNav li").on("click", function(e){
function updateTipjarScript (){
var tipjarHtml = '';
tipjarHtml += '/* BTCPay Server Crypto Tip-jar Script for OpenSimulator Plugin v0.1.2.\n\n';
tipjarHtml += '/* BTCPay Server Crypto Tip-jar Script for OpenSimulator Plugin v0.1.2.1.\n\n';
tipjarHtml += 'THIS SCRIPT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n';
tipjarHtml += 'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n';
@@ -623,7 +623,7 @@ $(".vDisplayCurrency, .rbDisplayCurrency").html('<option value="'+ defaultCurren
function updateVendorScript(){
var vendorHtml = '';
vendorHtml += '/* BTCPay Server Single Product Vendor Script for OpenSimulator Plugin v0.1.2.\n\n';
vendorHtml += '/* BTCPay Server Single Product Vendor Script for OpenSimulator Plugin v0.1.2.1.\n\n';
vendorHtml += 'THIS SCRIPT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n';
vendorHtml += 'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n';
@@ -1154,7 +1154,7 @@ $("#vDisplayCurrency, #vItemPrice, #vNotificationEmail, #vRedirectURL, #vCheckou
function updateRentalBoxScript(){
var rentalBoxHtml = '';
rentalBoxHtml += '/* BTCPay Server Parcels Rental Script for OpenSimulator Plugin v0.1.2.\n\n';
rentalBoxHtml += '/* BTCPay Server Parcels Rental Script for OpenSimulator Plugin v0.1.2.1.\n\n';
rentalBoxHtml += 'THIS SCRIPT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n';
rentalBoxHtml += 'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n';