From 227beecc66a3f6b1335a13cfcfc52a749ed3fac1 Mon Sep 17 00:00:00 2001
From: Adil El Farissi <144741970+AdilElFarissi@users.noreply.github.com>
Date: Sat, 2 Nov 2024 21:46:29 +0000
Subject: [PATCH] Fix to crash when the store don't have a wallet and a default
payment method set
---
.../BTCPayServer.Plugins.OpenSimulator.csproj | 2 +-
.../Controllers/UIOpenSimulatorController.cs | 3 ++-
.../Resources/js/opensimulator.js | 6 +++---
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/BTCPayServer.Plugins.OpenSimulator/BTCPayServer.Plugins.OpenSimulator.csproj b/BTCPayServer.Plugins.OpenSimulator/BTCPayServer.Plugins.OpenSimulator.csproj
index 1de7f9f..d28b7cc 100644
--- a/BTCPayServer.Plugins.OpenSimulator/BTCPayServer.Plugins.OpenSimulator.csproj
+++ b/BTCPayServer.Plugins.OpenSimulator/BTCPayServer.Plugins.OpenSimulator.csproj
@@ -7,7 +7,7 @@
OpenSimulator Plugin For BTCPay
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.
- 0.1.2
+ 0.1.2.1
diff --git a/BTCPayServer.Plugins.OpenSimulator/Controllers/UIOpenSimulatorController.cs b/BTCPayServer.Plugins.OpenSimulator/Controllers/UIOpenSimulatorController.cs
index 2fae1b9..7b14ac2 100644
--- a/BTCPayServer.Plugins.OpenSimulator/Controllers/UIOpenSimulatorController.cs
+++ b/BTCPayServer.Plugins.OpenSimulator/Controllers/UIOpenSimulatorController.cs
@@ -28,10 +28,11 @@ public class UIOpenSimulatorController : Controller
public async Task 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()
});
diff --git a/BTCPayServer.Plugins.OpenSimulator/Resources/js/opensimulator.js b/BTCPayServer.Plugins.OpenSimulator/Resources/js/opensimulator.js
index 74b6459..6ab11d1 100644
--- a/BTCPayServer.Plugins.OpenSimulator/Resources/js/opensimulator.js
+++ b/BTCPayServer.Plugins.OpenSimulator/Resources/js/opensimulator.js
@@ -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('